/* =============================================
   login.css — Trampix Auth
   Split-screen layout, professional design
   ============================================= */

:root {
    --bg: #060310;
    --surface: #0c0817;
    --surface-elevated: #140d20;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --border-focus: rgba(138, 5, 190, 0.45);
    --text: #f2ecf8;
    --text-secondary: #b5a3ca;
    --text-muted: #8a77a0;
    --accent: #8a05be;
    --accent-hover: #9e18d4;
    --accent-soft: rgba(138, 5, 190, 0.08);
    --gold: #d4af37;
    --success: #3dba7a;
    --font-display: 'Sora', 'Manrope', system-ui, sans-serif;
    --font-body: 'Manrope', 'Segoe UI', system-ui, sans-serif;
    --radius: 14px;
    --radius-sm: 10px;
    --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { 
    height: 100%; 
    width: 100%;
    overflow-x: hidden;
}

body {
    min-height: 100%;
    width: 100%;
    overflow-x: hidden;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button, input, select { font: inherit; }
button { border: 0; background: none; cursor: pointer; }
fieldset { border: 0; padding: 0; }

/* =============================================
   LOADING
   ============================================= */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s, visibility 0.15s;
    background: rgba(138, 5, 190, 0.15);
    overflow: hidden;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-overlay.finishing {
    transition: opacity 0.4s 0.15s, visibility 0.4s 0.15s;
    opacity: 0;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #8a05be, #b44dff, #8a05be);
    border-radius: 0 2px 2px 0;
    transition: width 0.3s ease-out;
    box-shadow: 0 0 8px rgba(138, 5, 190, 0.5);
}

.loading-overlay.active .loading-bar {
    animation: loadbar-progress 2.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.loading-overlay.finishing .loading-bar {
    width: 100% !important;
    animation: none;
    transition: width 0.2s ease-out;
}

@keyframes loadbar-progress {
    0%   { width: 0%; }
    15%  { width: 35%; }
    40%  { width: 55%; }
    65%  { width: 72%; }
    85%  { width: 82%; }
    100% { width: 88%; }
}

.loading-spinner {
    display: none;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-shimmer {
    background: linear-gradient(90deg, #1a0f2e 25%, #2a1845 50%, #1a0f2e 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

/* =============================================
   LAYOUT — Split screen
   ============================================= */

.auth-layout {
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 1fr;
}

/* =============================================
   LEFT SIDE — Branding (hidden on mobile)
   ============================================= */

.auth-side {
    display: none;
}

/* =============================================
   RIGHT SIDE — Auth forms
   ============================================= */

.auth-main {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    padding: 0 24px 32px;
}

.auth-main__inner {
    width: 100%;
    max-width: 400px;
    margin: auto auto;
}

/* =============================================
   LOGO
   ============================================= */

.auth-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.auth-logo__img {
    display: block;
    height: 32px;
    width: auto;
}

.auth-logo--mobile {
    display: block;
    padding: 20px 24px;
    margin: 0 -24px 0;
}

/* =============================================
   AUTH STATES
   ============================================= */

.auth-state {
    margin-top: 48px;
}

.auth-state[hidden] {
    display: none !important;
}

.auth-heading {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 6vw, 2.2rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.03em;
    color: var(--text);
    text-align: center;
}

.auth-desc {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.6;
    text-align: center;
}

/* =============================================
   GOOGLE BUTTON
   ============================================= */

.auth-google {
    margin-top: 28px;
    width: 100%;
    height: 52px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #fff;
    color: #1a1a1a;
    font-weight: 700;
    font-size: 0.94rem;
    transition: box-shadow 0.15s;
    border: none;
}

.auth-google:hover:not(:disabled) {
    box-shadow: 0 4px 18px rgba(255, 255, 255, 0.06);
}

.auth-google:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-google__icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.78rem;
    background: conic-gradient(from 180deg, #4285f4, #ea4335, #fbbc05, #34a853, #4285f4);
    color: #fff;
    flex-shrink: 0;
}

/* =============================================
   PERKS LIST (mobile — below Google button)
   ============================================= */

.auth-perks {
    margin-top: 32px;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 16px;
}

.auth-perks li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.auth-perks .material-symbols-rounded {
    font-size: 0.9rem;
    color: var(--accent);
    font-variation-settings: 'FILL' 1;
    flex-shrink: 0;
}

/* =============================================
   TERMS TEXT (guest state)
   ============================================= */

.auth-terms {
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.6;
}

.auth-terms a {
    color: var(--text-secondary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-terms a:hover {
    color: var(--text);
}

/* =============================================
   USER CARD (setup state)
   ============================================= */

.auth-user-card {
    margin-top: 24px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

/* =============================================
   ROLE CARDS (Selective Goal)
   ============================================= */

.role-grid {
    margin-top: 32px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.role-card {
    padding: 32px 24px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.role-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, var(--accent) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1;
}

.role-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    background: var(--surface-elevated);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.role-card:hover::after {
    opacity: 0.05;
}

.role-card__icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 1.8rem;
    transition: all 0.3s;
    z-index: 2;
}

.role-card:hover .role-card__icon {
    transform: scale(1.1) rotate(-5deg);
    background: var(--accent);
    color: white;
}

.role-card__title {
    display: block;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    z-index: 2;
}

.role-card__desc {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    max-width: 240px;
    z-index: 2;
}

.role-card[aria-pressed="true"] {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 0 1px var(--accent) inset;
}


/* =============================================
   CATEGORY GRID (step 2 for prestador)
   ============================================= */

.category-grid {
    margin-top: 28px;
    display: grid;
    gap: 8px;
}

.category-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 600;
    text-align: left;
    transition: border-color 0.15s, background 0.15s;
}

.category-card .material-symbols-rounded {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--text-secondary);
    font-size: 1.15rem;
    flex-shrink: 0;
}

.category-card:hover {
    border-color: var(--border-hover);
    background: var(--surface-elevated);
}

.category-card:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* =============================================
   BACK STEP BUTTON
   ============================================= */

.auth-back-step {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 24px;
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.15s;
}

.auth-back-step .material-symbols-rounded {
    font-size: 1rem;
}

.auth-back-step:hover {
    color: var(--text-secondary);
}

/* =============================================
   BACK LINK
   ============================================= */

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 32px;
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s;
}

.auth-back .material-symbols-rounded {
    font-size: 1rem;
}

.auth-back:hover {
    color: var(--text-secondary);
}

/* =============================================
   TOAST
   ============================================= */

.auth-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    min-width: 240px;
    max-width: min(90vw, 400px);
    padding: 12px 18px;
    border-radius: var(--radius);
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    color: var(--text);
    font-size: 0.86rem;
    font-weight: 600;
    text-align: center;
    z-index: 8000;
    animation: toastIn 0.2s var(--ease);
}

.auth-toast[hidden] { display: none; }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(6px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* =============================================
   DESKTOP — Split screen (≥ 900px)
   ============================================= */

@media (min-width: 900px) {
    .auth-layout {
        grid-template-columns: 1fr 1fr;
    }

    /* Left branding side */
    .auth-side {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 48px 40px;
        background:
            radial-gradient(ellipse 80% 60% at 30% 20%, rgba(138, 5, 190, 0.12) 0%, transparent 60%),
            var(--surface);
        border-right: 1px solid var(--border);
    }

    .auth-side__content {
        max-width: 400px;
    }

    .auth-side__title {
        margin-top: 48px;
        font-family: var(--font-display);
        font-size: clamp(1.6rem, 2.4vw, 2.2rem);
        font-weight: 800;
        line-height: 1.18;
        letter-spacing: -0.03em;
        color: var(--text);
    }

    .auth-side__text {
        margin-top: 14px;
        color: var(--text-muted);
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .auth-side__features {
        margin-top: 36px;
        list-style: none;
        display: grid;
        gap: 16px;
    }

    .auth-side__features li {
        display: flex;
        align-items: center;
        gap: 12px;
        color: var(--text-secondary);
        font-size: 0.9rem;
        font-weight: 500;
    }

    .auth-side__features .material-symbols-rounded {
        font-size: 1.15rem;
        color: var(--accent);
        font-variation-settings: 'FILL' 1;
    }

    /* Hide mobile-only elements on desktop */
    .auth-logo--mobile,
    .auth-perks {
        display: none;
    }

    /* Right side adjustments */
    .auth-main {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100dvh;
        padding: 48px;
    }

    .auth-main__inner {
        max-width: 380px;
    }

    .auth-heading {
        font-size: 1.85rem;
        text-align: left;
    }

    .auth-desc {
        text-align: left;
    }

    .auth-state {
        margin-top: 0;
    }

    .role-grid {
        grid-template-columns: 1fr 1fr;
    }

    .role-card {
        padding: 32px 24px;
    }


    .role-card small {
        margin-top: 2px;
    }
}

/* =============================================
   WIDE DESKTOP (≥ 1200px)
   ============================================= */

@media (min-width: 1200px) {
    .auth-side__title {
        font-size: 2.4rem;
    }

    .auth-main__inner {
        max-width: 400px;
    }
}

/* =============================================
   SMALL MOBILE (≤ 400px)
   ============================================= */

@media (max-width: 400px) {
    .auth-main {
        padding: 48px 24px;
        justify-content: center; /* Volta a centrar, mas o padding protege o topo */
        background: radial-gradient(circle at 50% 40%, rgba(138, 5, 190, 0.08) 0%, transparent 70%);
    }

    .auth-logo--mobile {
        margin-bottom: 64px;
    }

    .auth-heading {
        font-size: 1.8rem;
        line-height: 1.25;
    }

    .auth-desc {
        margin-top: 16px;
        font-size: 1rem;
    }

    .auth-google {
        margin-top: 40px;
    }

    .auth-perks {
        margin-top: 48px;
        gap: 20px;
    }

    .auth-back {
        margin-top: 64px;
    }
}
