/* =========================================================
   Workshop — Algemi Brand-Aligned Light Theme
   Fonts: Fraunces (optical serif display) + Manrope (geometric sans)
   ========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* --- Palette --- */
    --color-bg: #fafaf8;
    --color-surface: #ffffff;
    --color-surface-hover: #f8f7f4;
    --color-surface-alt: #f5f4f1;
    --color-surface-warm: #fef9f4;
    --color-surface-glass: rgba(255, 255, 255, 0.72);

    /* Algemi signature gradients */
    --grad-purple: #c82dff;
    --grad-pink: #ff6a6a;
    --grad-orange: #ffbc00;
    --grad-violet: #8b5cf6;
    --grad-blue: #3b82f6;
    --grad-cyan: #06b6d4;
    --grad-lime: #84cc16;
    --grad-rose: #fb7185;

    /* Primary gradients */
    --gradient-primary: linear-gradient(135deg, #c82dff 0%, #ff6a6a 50%, #ffbc00 100%);
    --gradient-cool: linear-gradient(135deg, #8b5cf6, #3b82f6, #06b6d4);
    --gradient-warm: linear-gradient(135deg, #ff6a6a, #ffbc00, #84cc16);
    --gradient-vivid: linear-gradient(135deg, #c82dff, #3b82f6, #06b6d4, #84cc16);

    /* Accent */
    --color-accent: #c82dff;
    --color-accent-light: rgba(200, 45, 255, 0.06);
    --color-accent-medium: rgba(200, 45, 255, 0.12);
    --color-danger: #ef4444;
    --color-danger-hover: #dc2626;
    --color-success: #10b981;

    /* Text */
    --color-text: #111827;
    --color-text-secondary: #374151;
    --color-text-muted: #6b7280;
    --color-text-subtle: #9ca3af;

    /* Border */
    --color-border: rgba(0, 0, 0, 0.06);
    --color-border-hover: rgba(200, 45, 255, 0.2);

    /* Geometry */
    --radius: 20px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --radius-pill: 100px;

    /* Shadows — soft, layered */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.05), 0 1px 4px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.03);
    --shadow-xl: 0 24px 80px rgba(0, 0, 0, 0.1), 0 8px 32px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 80px rgba(200, 45, 255, 0.08);
    --shadow-glow-strong: 0 8px 60px rgba(200, 45, 255, 0.15);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.02), 0 8px 40px rgba(0, 0, 0, 0.04);

    /* Timing */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Background layer --- */

.bg-layer {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background: var(--color-bg);
}

.bg-mesh {
    position: absolute;
    inset: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(200, 45, 255, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(255, 106, 106, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 80%, rgba(255, 188, 0, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 40% 30%, rgba(59, 130, 246, 0.03) 0%, transparent 50%);
    animation: meshDrift 40s ease-in-out infinite;
}

@keyframes meshDrift {
    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(2%, -1%) rotate(0.5deg);
    }
    50% {
        transform: translate(-1%, 2%) rotate(-0.5deg);
    }
    75% {
        transform: translate(1%, 1%) rotate(0.3deg);
    }
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    pointer-events: none;
    will-change: transform;
}

.bg-orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #c82dff 0%, transparent 70%);
    top: -8%;
    right: -3%;
    animation: orbFloat1 28s ease-in-out infinite;
}

.bg-orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #ffbc00 0%, transparent 70%);
    bottom: -5%;
    left: -3%;
    animation: orbFloat2 32s ease-in-out infinite;
}

.bg-orb-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, #ff6a6a 0%, transparent 70%);
    top: 45%;
    left: 50%;
    animation: orbFloat3 24s ease-in-out infinite;
}

.bg-orb-4 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, #3b82f6 0%, transparent 70%);
    top: 15%;
    left: 20%;
    opacity: 0.08;
    animation: orbFloat4 36s ease-in-out infinite;
}

@keyframes orbFloat1 {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(-30px, 25px) scale(1.04);
    }
    66% {
        transform: translate(15px, -15px) scale(0.96);
    }
}

@keyframes orbFloat2 {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(25px, -35px) scale(1.06);
    }
    66% {
        transform: translate(-15px, 15px) scale(0.94);
    }
}

@keyframes orbFloat3 {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(-50px, -25px) scale(1.08);
    }
}

@keyframes orbFloat4 {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(40px, 20px) scale(1.1);
    }
}

/* Subtle grain texture */
.bg-grain {
    position: absolute;
    inset: 0;
    opacity: 0.3;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    background-size: 256px 256px;
    pointer-events: none;
}

/* Subtle dot grid */
.bg-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    opacity: 0.5;
}

/* Cursor glow */
.cursor-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(200, 45, 255, 0.04) 0%, rgba(255, 106, 106, 0.02) 30%, transparent 60%);
    pointer-events: none;
    z-index: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.4s ease;
    opacity: 0;
    will-change: left, top;
}

.cursor-glow.active {
    opacity: 1;
}

/* --- Base --- */

body {
    font-family: 'Manrope', sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.65;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    max-width: 920px;
    margin: 0 auto;
    padding: 32px;
    position: relative;
    z-index: 1;
    transition:
        opacity 0.4s var(--ease-out),
        transform 0.4s var(--ease-out);
}

/* --- Gradient text utility --- */

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text-cool {
    background: var(--gradient-cool);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text-vivid {
    background: var(--gradient-vivid);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 6s ease infinite;
}

@keyframes gradientShift {
    0%,
    100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* --- Card system — glass morphism + gradient border --- */

.glow-card {
    position: relative;
    background: var(--color-surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition:
        box-shadow 0.5s var(--ease-out),
        transform 0.5s var(--ease-out);
    will-change: transform;
}

/* Gradient border via mask-composite */
.glow-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    padding: 1.5px;
    background: linear-gradient(
        135deg,
        rgba(200, 45, 255, 0.15),
        rgba(255, 106, 106, 0.08),
        rgba(255, 188, 0, 0.12),
        rgba(59, 130, 246, 0.08),
        rgba(200, 45, 255, 0.06)
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    transition: opacity 0.5s ease;
    opacity: 0.5;
}

.glow-card:hover::before {
    opacity: 1;
    background: linear-gradient(
        135deg,
        rgba(200, 45, 255, 0.4),
        rgba(255, 106, 106, 0.25),
        rgba(255, 188, 0, 0.3),
        rgba(59, 130, 246, 0.2),
        rgba(200, 45, 255, 0.15)
    );
}

/* Mouse-tracking radial glow */
.glow-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    background: radial-gradient(
        600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(200, 45, 255, 0.04),
        transparent 40%
    );
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.glow-card:hover::after {
    opacity: 1;
}

.glow-card:hover {
    box-shadow: var(--shadow-card), var(--shadow-glow);
}

/* 3D tilt card */
.glow-card.tilt-card {
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* Prevent text jitter during 3D transforms */
.glow-card.tilt-card > * {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Animated gradient border variant */
.glow-card-animated::before {
    background: conic-gradient(
        from var(--border-angle, 0deg),
        var(--grad-purple),
        var(--grad-pink),
        var(--grad-orange),
        var(--grad-blue),
        var(--grad-cyan),
        var(--grad-purple)
    );
    animation: rotateBorder 4s linear infinite;
    opacity: 0.25;
}

.glow-card-animated:hover::before {
    opacity: 0.6;
}

@property --border-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes rotateBorder {
    to {
        --border-angle: 360deg;
    }
}

/* --- Header --- */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--color-border);
    animation: fadeSlideDown 0.6s var(--ease-out) both;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fraunces', serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
    box-shadow: 0 4px 16px rgba(200, 45, 255, 0.2);
    flex-shrink: 0;
}

.header h1 {
    font-family: 'Fraunces', serif;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.2;
    font-optical-sizing: auto;
}

.header-link {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    border: 1.5px solid var(--color-border);
    transition: all 0.35s var(--ease-out);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--color-surface-glass);
    backdrop-filter: blur(12px);
    letter-spacing: 0.02em;
}

.header-link:hover {
    color: var(--color-text);
    border-color: var(--color-border-hover);
    background: var(--color-accent-light);
    box-shadow:
        var(--shadow-sm),
        0 0 20px rgba(200, 45, 255, 0.06);
    transform: translateY(-2px);
}

/* --- Login Page --- */

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 84vh;
    animation: fadeIn 0.5s var(--ease-out) both;
}

.login-card {
    padding: 56px 48px;
    width: 100%;
    max-width: 480px;
    text-align: center;
}

.login-logo-wrap {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 32px;
}

.login-logo {
    width: 80px;
    height: 80px;
    border-radius: 22px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fraunces', serif;
    font-weight: 700;
    font-size: 2rem;
    color: white;
    box-shadow: 0 12px 40px rgba(200, 45, 255, 0.25);
    position: relative;
    z-index: 2;
    animation: logoFloat 5s ease-in-out infinite;
}

.login-logo-ring {
    position: absolute;
    inset: -8px;
    border-radius: 28px;
    border: 2px solid transparent;
    background: conic-gradient(
            from var(--ring-angle, 0deg),
            var(--grad-purple),
            var(--grad-pink),
            var(--grad-orange),
            var(--grad-cyan),
            var(--grad-purple)
        )
        border-box;
    -webkit-mask:
        linear-gradient(#fff 0 0) padding-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.3;
    animation: ringRotate 8s linear infinite;
    z-index: 1;
}

@property --ring-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes ringRotate {
    to {
        --ring-angle: 360deg;
    }
}

@keyframes logoFloat {
    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-6px) rotate(1deg);
    }
}

.login-card h1 {
    font-family: 'Fraunces', serif;
    font-size: 2.8rem;
    font-weight: 600;
    margin-bottom: 10px;
    letter-spacing: -0.04em;
    line-height: 1.1;
    font-optical-sizing: auto;
}

.login-card .subtitle {
    color: var(--color-text-muted);
    margin-bottom: 40px;
    font-size: 0.95rem;
    line-height: 1.6;
    font-weight: 400;
}

.login-card .subtitle strong {
    color: var(--color-text-secondary);
    font-weight: 600;
}

/* --- Forms & Inputs --- */

input[type='text'],
textarea {
    width: 100%;
    padding: 14px 20px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-family: 'Manrope', sans-serif;
    color: var(--color-text);
    background: var(--color-surface);
    transition: all 0.35s var(--ease-out);
    outline: none;
}

input[type='text']::placeholder,
textarea::placeholder {
    color: var(--color-text-subtle);
    font-weight: 400;
}

input[type='text']:focus,
textarea:focus {
    border-color: var(--grad-purple);
    box-shadow:
        0 0 0 4px rgba(200, 45, 255, 0.06),
        0 2px 8px rgba(200, 45, 255, 0.08);
    background: var(--color-surface);
}

input[type='text']:hover:not(:focus),
textarea:hover:not(:focus) {
    border-color: rgba(0, 0, 0, 0.12);
    background: var(--color-surface-hover);
}

textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.6;
}

/* --- Select dropdown --- */

select.detail-select {
    width: 100%;
    padding: 14px 20px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-family: 'Manrope', sans-serif;
    color: var(--color-text);
    background: var(--color-surface);
    transition: all 0.35s var(--ease-out);
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px;
}

select.detail-select:focus {
    border-color: var(--grad-purple);
    box-shadow:
        0 0 0 4px rgba(200, 45, 255, 0.06),
        0 2px 8px rgba(200, 45, 255, 0.08);
}

select.detail-select:hover:not(:focus) {
    border-color: rgba(0, 0, 0, 0.12);
    background-color: var(--color-surface-hover);
}

.method-select-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.method-other-input {
    animation: fadeSlideUp 0.25s var(--ease-out) both;
}

.form-group {
    margin-bottom: 24px;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 0.72rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-family: 'Manrope', sans-serif;
}

/* --- Buttons --- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    font-family: 'Manrope', sans-serif;
    cursor: pointer;
    transition: all 0.35s var(--ease-out);
    position: relative;
    letter-spacing: 0.01em;
    overflow: hidden;
}

.btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: rippleEffect 0.65s ease-out;
    pointer-events: none;
}

@keyframes rippleEffect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.btn-primary {
    background: var(--gradient-primary);
    background-size: 200% 200%;
    color: white;
    box-shadow: 0 4px 20px rgba(200, 45, 255, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 8px 32px rgba(200, 45, 255, 0.3);
    transform: translateY(-2px);
    background-position: 100% 0%;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(200, 45, 255, 0.2);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.btn-danger:hover {
    box-shadow: 0 6px 24px rgba(239, 68, 68, 0.25);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--color-surface-glass);
    backdrop-filter: blur(12px);
    color: var(--color-text-secondary);
    border: 1.5px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-accent-light);
    border-color: var(--color-border-hover);
    color: var(--color-text);
    box-shadow: var(--shadow-sm);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.8rem;
}

.btn-icon {
    padding: 8px 10px;
    background: transparent;
    border: 1.5px solid var(--color-border);
    color: var(--color-text-muted);
    border-radius: var(--radius-xs);
}

.btn-icon:hover {
    background: var(--color-accent-light);
    border-color: var(--color-border-hover);
    color: var(--grad-purple);
    transform: translateY(-1px);
}

.btn-icon:disabled {
    opacity: 0.15;
    cursor: not-allowed;
}

.btn-icon:disabled:hover {
    background: transparent;
    border-color: var(--color-border);
    color: var(--color-text-muted);
    transform: none;
}

/* Ghost button variant */
.btn-ghost {
    background: transparent;
    color: var(--color-text-muted);
    border: none;
    padding: 10px 18px;
    font-weight: 600;
}

.btn-ghost:hover {
    background: var(--color-accent-light);
    color: var(--grad-purple);
}

/* --- Error --- */

.error-msg {
    color: var(--color-danger);
    font-size: 0.88rem;
    margin-top: 16px;
    animation: shake 0.4s ease;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* --- Ideas List --- */

.ideas-section-title {
    font-family: 'Manrope', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-text-muted);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.ideas-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--color-border), transparent 80%);
}

.ideas-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: white;
    font-size: 0.68rem;
    font-weight: 800;
    min-width: 26px;
    height: 26px;
    border-radius: 13px;
    padding: 0 8px;
    box-shadow: 0 2px 8px rgba(200, 45, 255, 0.2);
}

.ideas-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.idea-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 26px;
    cursor: pointer;
    transition: all 0.4s var(--ease-out);
}

.idea-item:hover {
    transform: translateY(-3px) translateX(2px);
    box-shadow: var(--shadow), var(--shadow-glow);
}

.idea-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 20px;
}

.idea-number {
    font-family: 'Fraunces', serif;
    font-size: 0.9rem;
    font-weight: 700;
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: linear-gradient(135deg, rgba(200, 45, 255, 0.08), rgba(255, 106, 106, 0.04));
    border: 1px solid rgba(200, 45, 255, 0.1);
    color: var(--grad-purple);
    transition: all 0.35s var(--ease-out);
}

.idea-item:hover .idea-number {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(200, 45, 255, 0.2);
    transform: scale(1.05);
}

.idea-text {
    flex: 1;
}

.idea-name {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 1.15rem;
    margin-bottom: 3px;
    letter-spacing: -0.02em;
    color: var(--color-text);
    line-height: 1.3;
    transition: color 0.3s ease;
}

.idea-item:hover .idea-name {
    color: var(--grad-purple);
}

.idea-person {
    color: var(--color-text-muted);
    font-size: 0.78rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.idea-person::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gradient-primary);
    flex-shrink: 0;
}

.idea-actions {
    flex-shrink: 0;
    margin-left: 12px;
    opacity: 0;
    transform: translateX(4px);
    transition: all 0.3s var(--ease-out);
}

.idea-item:hover .idea-actions {
    opacity: 1;
    transform: translateX(0);
}

.idea-arrow {
    color: var(--color-text-subtle);
    font-size: 1.2rem;
    margin-left: 10px;
    transition:
        transform 0.35s var(--ease-out),
        color 0.3s ease;
}

.idea-item:hover .idea-arrow {
    transform: translateX(6px);
    color: var(--grad-purple);
}

/* --- Add idea form --- */

.add-idea-form {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    padding: 28px;
    margin-top: 28px;
    animation: fadeSlideUp 0.5s var(--ease-out) both;
    animation-delay: 0.2s;
}

.add-idea-form .form-group {
    flex: 1;
    margin-bottom: 0;
}

.add-idea-form .btn {
    align-self: flex-end;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    color: var(--color-text-muted);
    padding: 72px 24px;
    font-size: 0.95rem;
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
    opacity: 0.5;
    animation: emptyPulse 3s ease-in-out infinite;
}

@keyframes emptyPulse {
    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.7;
    }
}

.empty-state-text {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 1.3rem;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}

.empty-state-sub {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-weight: 400;
}

/* --- Detail Page --- */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.84rem;
    margin-bottom: 32px;
    cursor: pointer;
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    transition: all 0.35s var(--ease-out);
    border: 1.5px solid transparent;
    background: transparent;
}

.back-link:hover {
    color: var(--color-text);
    background: var(--color-surface-glass);
    backdrop-filter: blur(12px);
    border-color: var(--color-border);
    box-shadow: var(--shadow-sm);
    transform: translateX(-4px);
}

.back-link .arrow {
    transition: transform 0.35s var(--ease-out);
    font-size: 1.15rem;
}

.back-link:hover .arrow {
    transform: translateX(-5px);
}

.detail-meta {
    padding: 36px;
    margin-bottom: 40px;
    animation: fadeSlideUp 0.5s var(--ease-out) both;
}

.detail-meta .form-group:last-of-type {
    margin-bottom: 0;
}

.detail-title {
    font-family: 'Fraunces', serif;
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    margin-bottom: 28px;
    line-height: 1.2;
}

/* --- Steps Section --- */

.steps-section {
    animation: fadeSlideUp 0.5s var(--ease-out) both;
    animation-delay: 0.15s;
}

.steps-section h2 {
    font-family: 'Fraunces', serif;
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--color-text);
}

.steps-section h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 24px;
    border-radius: 2px;
    background: var(--gradient-primary);
    flex-shrink: 0;
}

.steps-table-wrapper {
    border-radius: var(--radius);
    overflow: hidden;
}

.steps-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface-glass);
}

.steps-table th {
    text-align: left;
    padding: 16px 22px;
    font-family: 'Manrope', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border-bottom: 1.5px solid var(--color-border);
    background: var(--color-surface-alt);
}

.steps-table td {
    padding: 14px 22px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
    transition: background 0.3s ease;
}

.steps-table tr:hover td {
    background: rgba(200, 45, 255, 0.02);
}

.steps-table tr:last-child td {
    border-bottom: none;
}

.steps-table .col-nr {
    width: 60px;
    text-align: center;
}

.step-number {
    font-family: 'Fraunces', serif;
    font-size: 0.9rem;
    font-weight: 700;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(200, 45, 255, 0.08), rgba(255, 106, 106, 0.04));
    color: var(--grad-purple);
    border: 1px solid rgba(200, 45, 255, 0.1);
    transition: all 0.3s var(--ease-out);
}

.steps-table tr:hover .step-number {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(200, 45, 255, 0.15);
}

.steps-table .col-actions {
    width: 120px;
    text-align: right;
}

.steps-table td input[type='text'],
.steps-table td select.detail-select {
    background: transparent;
    border-color: transparent;
    padding: 10px 16px;
    font-size: 0.9rem;
}

.steps-table td input[type='text']:focus,
.steps-table td select.detail-select:focus {
    background: var(--color-surface);
    border-color: var(--grad-purple);
}

.steps-table td input[type='text']:hover:not(:focus),
.steps-table td select.detail-select:hover:not(:focus) {
    background: var(--color-surface-hover);
    border-color: transparent;
}

.steps-table td .method-other-input {
    margin-top: 6px;
    padding: 8px 12px;
    font-size: 0.85rem;
}

.step-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
    opacity: 0;
    transform: translateX(4px);
    transition: all 0.3s var(--ease-out);
}

.steps-table tr:hover .step-actions {
    opacity: 1;
    transform: translateX(0);
}

/* --- Step Cards Layout --- */

.steps-list-wrapper {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-surface-glass);
}

.steps-list {
    display: flex;
    flex-direction: column;
}

.step-card {
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border);
    transition: background 0.3s ease;
    cursor: grab;
}

.step-card:last-child {
    border-bottom: none;
}

.step-card:hover {
    background: rgba(200, 45, 255, 0.02);
}

.step-card:hover .step-actions {
    opacity: 1;
    transform: translateX(0);
}

.step-card.dragging {
    opacity: 0.4;
}

.step-card.drag-over {
    border-top: 2px solid var(--grad-purple);
}

.step-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.step-card-header .step-desc {
    flex: 1;
    background: transparent;
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 0.95rem;
    font-family: 'Manrope', sans-serif;
    font-weight: 500;
    color: var(--color-text);
    transition: all 0.2s ease;
}

.step-card-header .step-desc:focus {
    background: var(--color-surface);
    border-color: var(--grad-purple);
    outline: none;
}

.step-card-header .step-desc:hover:not(:focus) {
    background: var(--color-surface-hover);
}

.step-card-details {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 12px;
    margin-top: 12px;
    padding-left: 48px;
}

.step-field label {
    display: block;
    font-family: 'Manrope', sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}

.step-field input[type='text'],
.step-field input[type='number'],
.step-field select.detail-select {
    width: 100%;
    background: transparent;
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    padding: 9px 14px;
    font-size: 0.88rem;
    font-family: 'Manrope', sans-serif;
    color: var(--color-text);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.step-field input[type='number'] {
    -moz-appearance: textfield;
}

.step-field input[type='number']::-webkit-inner-spin-button,
.step-field input[type='number']::-webkit-outer-spin-button {
    opacity: 1;
}

.step-field input[type='text']:focus,
.step-field input[type='number']:focus,
.step-field select.detail-select:focus {
    background: var(--color-surface);
    border-color: var(--grad-purple);
    outline: none;
}

.step-field input[type='text']:hover:not(:focus),
.step-field input[type='number']:hover:not(:focus),
.step-field select.detail-select:hover:not(:focus) {
    background: var(--color-surface-hover);
}

.step-field .method-other-input {
    margin-top: 6px;
    padding: 7px 12px;
    font-size: 0.83rem;
}

.step-field-narrow {
    max-width: 130px;
}

.steps-list-footer {
    padding: 18px 24px;
    border-top: 1px solid var(--color-border);
}

@media (max-width: 900px) {
    .step-card-details {
        grid-template-columns: 1fr 1fr;
        padding-left: 0;
    }

    .step-field-narrow {
        max-width: none;
    }
}

/* --- Data Requirements Table --- */

.data-section {
    margin-top: 40px;
    animation: fadeSlideUp 0.5s var(--ease-out) both;
    animation-delay: 0.2s;
}

.data-section h2 {
    font-family: 'Fraunces', serif;
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.data-section h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 24px;
    border-radius: 2px;
    background: var(--gradient-primary);
    flex-shrink: 0;
}

.data-table .col-data-name {
    width: 40%;
}

.data-table .col-data-source {
    width: auto;
}

/* --- Costs Table --- */

.costs-section {
    margin-top: 40px;
    animation: fadeSlideUp 0.5s var(--ease-out) both;
    animation-delay: 0.25s;
}

.costs-section h2 {
    font-family: 'Fraunces', serif;
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.costs-section h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 24px;
    border-radius: 2px;
    background: var(--gradient-primary);
    flex-shrink: 0;
}

.costs-table .col-cost-desc {
    width: 50%;
}

.costs-table .col-cost-indication {
    width: auto;
}

/* --- Add Step Row --- */

.add-step-row td {
    padding-top: 14px;
}

.add-step-row input[type='text'] {
    font-size: 0.88rem;
    padding: 10px 16px;
}

/* --- Inline Edit --- */

.inline-edit {
    display: flex;
    gap: 6px;
    align-items: center;
}

.inline-edit input {
    flex: 1;
}

/* --- Save Status --- */

.save-status {
    font-size: 0.8rem;
    margin-top: 16px;
    min-height: 1.4em;
    transition: all 0.3s ease;
    font-family: 'Manrope', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.save-status.saving {
    color: var(--color-text-muted);
    opacity: 1;
}

.save-status.saving::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(200, 45, 255, 0.15);
    border-top-color: var(--grad-purple);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.save-status.saved {
    color: var(--color-success);
    opacity: 1;
}

.save-status.saved::before {
    content: '';
    width: 16px;
    height: 16px;
    display: inline-block;
    background: var(--color-success);
    border-radius: 50%;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 8l3 3 5-5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 8l3 3 5-5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    animation: checkPop 0.3s var(--ease-spring);
}

@keyframes checkPop {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.save-status.fade-out {
    opacity: 0;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* --- Animations --- */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeSlideDown {
    from {
        opacity: 0;
        transform: translateY(-16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }
    50% {
        transform: scale(1.03) translateY(-3px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.animate-in {
    animation: fadeSlideUp 0.4s var(--ease-out) both;
}

.idea-item {
    animation: fadeSlideUp 0.45s var(--ease-out) both;
}

/* --- Drag & Drop styles --- */

.idea-item.dragging {
    opacity: 0.35;
    transform: scale(0.97);
}

.idea-item.drag-over {
    border-top: 2.5px solid var(--grad-purple);
}

.steps-table tr.dragging {
    opacity: 0.3;
}

.steps-table tr.drag-over td {
    border-top: 2.5px solid var(--grad-purple);
    background: rgba(200, 45, 255, 0.03);
}

/* --- Toast --- */

.toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    padding: 16px 26px;
    border-radius: var(--radius-sm);
    background: var(--color-surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1.5px solid var(--color-border);
    color: var(--color-text);
    font-family: 'Manrope', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    animation: toastIn 0.4s var(--ease-spring) both;
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast.toast-out {
    animation: toastOut 0.3s var(--ease-out) both;
}

.toast-success {
    border-color: rgba(16, 185, 129, 0.25);
}

.toast-success::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.06), transparent);
    pointer-events: none;
}

.toast-error {
    border-color: rgba(239, 68, 68, 0.25);
}

.toast-error::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.06), transparent);
    pointer-events: none;
}

/* Toast progress bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    animation: toastProgress 3s linear forwards;
}

.toast-success .toast-progress {
    background: var(--color-success);
}

.toast-error .toast-progress {
    background: var(--color-danger);
}

@keyframes toastProgress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(24px) scale(0.9);
    }
}

/* --- Confirm Dialog --- */

.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(250, 250, 248, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.confirm-dialog {
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius);
    padding: 40px;
    max-width: 440px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    animation: scaleIn 0.3s var(--ease-spring);
    text-align: center;
}

.confirm-dialog h3 {
    font-family: 'Fraunces', serif;
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--color-text);
}

.confirm-dialog p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: 32px;
    line-height: 1.6;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* --- Particle burst effect --- */

.particle {
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    border-radius: 50%;
    animation: particleBurst 0.9s var(--ease-out) forwards;
}

@keyframes particleBurst {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--px), var(--py)) scale(0);
    }
}

/* --- Keyboard hint --- */

.kbd-hint {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    color: var(--color-text-subtle);
    margin-top: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-weight: 500;
}

.kbd-hint kbd {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: 5px;
    font-family: 'Manrope', sans-serif;
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--color-text-muted);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

.form-group:focus-within ~ .kbd-hint,
.kbd-hint.visible {
    opacity: 1;
}

/* --- Floating decoration shapes --- */

.floating-shape {
    position: fixed;
    pointer-events: none;
    z-index: -1;
    opacity: 0.04;
    will-change: transform;
}

.floating-shape svg {
    width: 100%;
    height: 100%;
}

/* --- Tag / badge --- */

.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.tag-gradient {
    background: linear-gradient(135deg, rgba(200, 45, 255, 0.08), rgba(255, 106, 106, 0.06));
    color: var(--grad-purple);
    border: 1px solid rgba(200, 45, 255, 0.1);
}

/* --- Responsive --- */

@media (max-width: 640px) {
    #app {
        padding: 18px;
    }

    .login-card {
        padding: 40px 24px;
    }

    .login-card h1 {
        font-size: 2.2rem;
    }

    .login-logo-wrap {
        width: 64px;
        height: 64px;
    }

    .login-logo {
        width: 64px;
        height: 64px;
        font-size: 1.6rem;
        border-radius: 18px;
    }

    .login-logo-ring {
        inset: -6px;
        border-radius: 22px;
    }

    .add-idea-form {
        flex-direction: column;
        align-items: stretch;
    }

    .steps-table .col-actions {
        width: 80px;
    }

    .steps-table .col-person {
        width: 120px;
    }

    .idea-actions {
        opacity: 1;
        transform: none;
    }

    .step-actions {
        opacity: 1;
        transform: none;
    }

    .header h1 {
        font-size: 1.25rem;
    }

    .detail-meta {
        padding: 24px;
    }

    .bg-orb-1 {
        width: 300px;
        height: 300px;
    }
    .bg-orb-2 {
        width: 250px;
        height: 250px;
    }
    .bg-orb-3 {
        width: 200px;
        height: 200px;
    }
    .bg-orb-4 {
        display: none;
    }

    .cursor-glow {
        display: none;
    }
}

/* --- Scrollbar --- */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(200, 45, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(200, 45, 255, 0.2);
}

/* --- Selection --- */

::selection {
    background: rgba(200, 45, 255, 0.12);
    color: var(--color-text);
}

/* --- Focus ring for accessibility --- */

*:focus-visible {
    outline: 2px solid var(--grad-purple);
    outline-offset: 3px;
}

input:focus-visible,
textarea:focus-visible,
button:focus-visible {
    outline: none;
}
