/* Home Page */

.home-page {
    --home-accent: var(--accent-color);
    --home-accent-hover: var(--accent-hover);
    min-height: 100vh;
    padding: 16px;
    display: grid;
    place-items: center;
    background:
        linear-gradient(rgba(24, 24, 27, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(24, 24, 27, 0.035) 1px, transparent 1px), var(--primary-color);
    background-size: 32px 32px;
}

.home-page.dark {
    background:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px), var(--primary-color);
    background-size: 32px 32px;
}

.home-shell {
    width: min(1280px, 100%);
    min-height: min(760px, calc(100vh - 32px));
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(390px, 0.92fr);
    overflow: hidden;
    background: var(--secondary-color);
    border: var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-xl);
}

.home-intro {
    position: relative;
    min-width: 0;
    padding: clamp(32px, 5vw, 64px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: var(--text-color);
    background: var(--primary-color);
    isolation: isolate;
}

.home-intro::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0.45;
    background:
        linear-gradient(120deg, transparent 62%, rgba(59, 130, 246, 0.1) 62%),
        radial-gradient(circle at 88% 12%, rgba(59, 130, 246, 0.12), transparent 26%);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brand img {
    width: 36px;
    height: 36px;
}

.intro-copy {
    margin: 106px 0 0;
    max-width: 520px;
}

.eyebrow,
.panel-kicker {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent-color);
}

.eyebrow span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--home-accent);
    box-shadow: 0 0 0 5px rgba(59, 130, 246, 0.14);
}

.home-intro h1 {
    margin-top: 18px;
    font-size: clamp(2.65rem, 5vw, 4rem);
    font-weight: 600;
    line-height: 0.98;
    letter-spacing: 0;
}

.intro-text {
    margin-top: 20px;
    max-width: 470px;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
}

.feature-list {
    margin-top: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px 22px;
    color: var(--text-color);
    font-size: 0.8rem;
    font-weight: 600;
    list-style: none;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.feature-list i {
    color: var(--accent-color);
}

.home-panel {
    position: relative;
    padding: clamp(28px, 4vw, 52px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 24px;
    color: var(--text-color);
    background: var(--secondary-color);
}

.panel-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 12px;
}

.panel-kicker {
    margin-bottom: 6px;
    color: var(--home-accent);
}

.home-panel h2 {
    font-size: clamp(1.65rem, 3vw, 2.3rem);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: 0;
}

.panel-actions {
    display: flex;
    gap: 8px;
}

@media (min-width: 861px) {
    .panel-actions {
        position: absolute;
        top: clamp(28px, 4vw, 52px);
        right: clamp(28px, 4vw, 52px);
    }
}

.panel-actions button {
    width: 38px;
    height: 38px;
    padding: 0;
    color: var(--text-secondary);
    background: var(--surface-color);
    border: var(--border);
    box-shadow: none;
}

.panel-actions button:hover {
    color: var(--home-accent);
    background: var(--surface-hover);
    box-shadow: none;
    transform: none;
}

.copyright {
    margin-top: auto;
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.field-group {
    display: grid;
    gap: 8px;
}

.field-group > label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.field-group > label i {
    width: 16px;
    color: var(--home-accent);
    text-align: center;
}

.input-wrapper {
    position: relative;
    width: 100%;
}

.input-wrapper input {
    width: 100%;
    min-height: 52px;
    padding: 12px 48px 12px 14px;
    color: var(--text-color);
    background: var(--primary-color);
    border: 1px solid transparent;
    border-radius: 6px;
    box-shadow: var(--box-shadow);
    font-size: 0.925rem;
    transition:
        border-color var(--transition-fast),
        box-shadow var(--transition-fast);
}

.input-wrapper input:hover {
    border-color: rgba(128, 128, 128, 0.35);
}

.input-wrapper input:focus {
    border-color: var(--home-accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

.input-wrapper input.is-scrambling {
    color: var(--home-accent);
    border-color: rgba(59, 130, 246, 0.45);
    font-variant-numeric: tabular-nums;
}

.input-wrapper input.is-generated {
    animation: generated-fade 0.45s ease-out;
}

@keyframes generated-fade {
    0% {
        border-color: var(--home-accent);
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
    }
    100% {
        border-color: transparent;
        box-shadow: var(--box-shadow);
    }
}

@media (prefers-reduced-motion: reduce) {
    .input-wrapper input.is-scrambling,
    .input-wrapper input.is-generated,
    .input-action.is-spinning i {
        animation: none;
    }
}

.input-action {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 40px;
    height: 40px;
    padding: 0;
    color: var(--text-secondary);
    background: transparent;
    border: 0;
    box-shadow: none;
}

.input-action:hover {
    color: var(--home-accent);
    background: var(--surface-hover);
    box-shadow: none;
    transform: none;
}

.input-action:hover i {
    transform: rotate(180deg);
}

.input-action i {
    transition: transform var(--transition-normal);
}

.input-action.is-spinning {
    color: var(--home-accent);
}

.input-action.is-spinning i {
    animation: input-action-spin 0.45s linear infinite;
}

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

.role-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px 16px;
    padding-top: 24px;
    border-top: var(--border);
}

.role-copy {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.role-copy > i {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: var(--home-accent);
    background: rgba(59, 130, 246, 0.1);
    border-radius: 6px;
}

.role-copy span {
    min-width: 0;
    display: grid;
}

.role-copy strong {
    font-size: 0.875rem;
}

.role-copy small {
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.role-actions button {
    min-width: 136px;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 6px;
    box-shadow: none;
    font-size: 0.78rem;
    font-weight: 700;
}

.role-cta {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Match the height of the adjacent button */
.role-cta .source-badge {
    min-height: 44px;
    padding: 0 12px;
}

.role-actions button i {
    font-size: 0.7rem;
}

.role-actions .primary-action {
    color: #fff;
    background: var(--home-accent);
    border-color: var(--home-accent);
}

.role-actions .primary-action:hover {
    background: var(--home-accent-hover);
    border-color: var(--home-accent-hover);
}

.role-actions .secondary-action {
    color: var(--text-color);
    background: var(--surface-color);
}

.role-actions .secondary-action:hover {
    background: var(--surface-hover);
}

@media (max-width: 860px) {
    .home-page {
        padding: 16px;
        place-items: start center;
    }

    .home-shell {
        min-height: auto;
        grid-template-columns: 1fr;
    }

    .home-intro {
        min-height: 300px;
        padding: 28px;
    }

    .intro-copy {
        margin: 48px 0 0;
    }

    .home-intro h1 {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }

    .intro-text {
        max-width: 560px;
    }
}

@media (max-width: 520px) {
    .home-page {
        padding: 0;
        background: var(--secondary-color);
    }

    .home-shell {
        width: 100%;
        min-height: 100svh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .home-intro {
        display: none;
    }

    .home-panel {
        padding: 30px 20px;
        gap: 20px;
    }

    .role-actions {
        grid-template-columns: 1fr;
        gap: 12px;
        padding-top: 20px;
    }

    .role-actions button {
        width: 100%;
        margin-bottom: 8px;
    }

    .role-cta {
        width: 100%;
        margin-bottom: 8px;
    }

    .role-cta button {
        flex: 1;
        margin-bottom: 0;
    }

    .mode-container {
        padding-top: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-shell,
    .input-action i {
        animation: none;
        transition: none;
    }
}
