/* ========================================
   AUTH.CSS — Login & Register
   CoudFy — Digital Solutions
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&display=swap');

/* ========================================
   01 — VARIÁVEIS
   ======================================== */
:root {
    --bg:           #04060b;
    --panel:        #060a12;
    --surface:      #0b1120;
    --cyan:         #00d9ff;
    --cyan-dim:     rgba(0, 217, 255, 0.07);
    --cyan-glow:    rgba(0, 217, 255, 0.18);
    --border:       rgba(0, 217, 255, 0.1);
    --border-mid:   rgba(255, 255, 255, 0.07);
    --white:        #d8e8f2;
    --muted:        #3d5470;
    --muted-2:      #7a95ae;
    --green:        #1ef08b;
    --red:          #ff4d6d;
    --ease:         cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
    margin: 0; padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'DM Sans', 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--white);
    min-height: 100vh;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--cyan) var(--panel);
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--panel); }
::-webkit-scrollbar-thumb { background: var(--cyan); border-radius: 10px; opacity: 0.5; }

a { text-decoration: none; color: inherit; }

/* ========================================
   02 — LAYOUT: visual = fundo total, form = painel lateral
   ======================================== */
.auth-page {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* ── Fundo total (atmosfera) ── */
.auth-visual {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: var(--bg);
    overflow: hidden;
}

/* Esconde conteúdo da marca — layout centralizado */
.auth-visual-content { display: none; }

.auth-visual-grid { display: none; }

.auth-visual-orb { display: none; }
    33%       { transform: translate(30px, -20px) scale(1.05); }
    66%       { transform: translate(-15px, 20px) scale(0.97); }
}

/* Pseudo-elementos removidos no layout centralizado */
.auth-visual::before,
.auth-visual::after { display: none; }

/* Conteúdo da marca */
.auth-visual-content {
    position: relative;
    z-index: 2;
    max-width: 380px;
    animation: fadeInLeft 1s var(--ease) 0.15s forwards;
    opacity: 0;
}

.auth-logo {
    width: 40px; height: 40px;
    object-fit: contain;
    filter: drop-shadow(0 0 14px rgba(0,217,255,0.5));
    margin-bottom: 22px;
    display: block;
}

.auth-brand-name {
    font-family: 'Syne', sans-serif;
    font-size: clamp(40px, 5vw, 56px);
    font-weight: 800;
    color: var(--white);
    letter-spacing: -2.5px;
    line-height: 1;
    display: block;
    margin-bottom: 10px;
}

.auth-brand-tagline {
    font-size: 10px;
    color: var(--cyan);
    font-weight: 600;
    letter-spacing: 4px;
    text-transform: uppercase;
    display: block;
    opacity: 0.65;
    margin-bottom: 56px;
}

/* Features como lista minimalista */
.auth-features {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.auth-feature-pill {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: all 0.3s ease;
    animation: fadeInLeft 0.65s var(--ease) forwards;
    opacity: 0;
    cursor: default;
}
.auth-feature-pill:first-child { border-top: 1px solid rgba(255,255,255,0.05); }
.auth-feature-pill:nth-child(1) { animation-delay: 0.45s; }
.auth-feature-pill:nth-child(2) { animation-delay: 0.6s; }
.auth-feature-pill:nth-child(3) { animation-delay: 0.75s; }

.auth-feature-pill:hover .auth-feature-icon {
    background: var(--cyan-dim);
    border-color: var(--border);
    color: var(--cyan);
}

.auth-feature-icon {
    width: 34px; height: 34px; flex-shrink: 0;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    color: var(--muted-2);
    transition: all 0.3s ease;
}

.auth-feature-text h4 {
    font-size: 12px; font-weight: 600;
    color: rgba(216,232,242,0.85);
    margin-bottom: 2px;
}
.auth-feature-text p {
    font-size: 11px; color: var(--muted); line-height: 1.4;
}

/* ========================================
   03 — PAINEL DO FORMULÁRIO
   ======================================== */
.auth-form-side {
    position: relative;
    z-index: 2;
    width: 460px;
    max-width: 92vw;
    min-height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 52px 48px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow-y: auto;
    margin: 40px 0;
}

/* Traço ciano no topo */
.auth-form-side::before {
    content: '';
    position: absolute; top: 0; left: 10%; right: 10%;
    height: 1.5px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--cyan) 30%,
        var(--cyan) 70%,
        transparent 100%
    );
    opacity: 0.55;
    border-radius: 0 0 2px 2px;
}

.auth-form-side::after { display: none; }

.auth-form-wrapper {
    width: 100%;
    animation: fadeInUp 0.7s var(--ease) 0.25s forwards;
    opacity: 0;
    position: relative; z-index: 1;
}

/* ========================================
   04 — CABEÇALHO DO FORMULÁRIO
   ======================================== */
.auth-form-header {
    margin-bottom: 34px;
}

.auth-form-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--cyan-dim);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 4px 11px;
    font-size: 10px;
    font-weight: 700;
    color: var(--cyan);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 18px;
    opacity: 0.9;
}
.auth-form-badge i { font-size: 9px; }

.auth-form-title {
    font-family: 'Syne', sans-serif;
    font-size: 25px;
    font-weight: 700;
    color: var(--white);
    line-height: 1.18;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.auth-form-title span {
    color: var(--cyan);
}

.auth-form-subtitle {
    font-size: 13px;
    color: var(--muted-2);
    line-height: 1.65;
}

/* ========================================
   05 — CAMPOS — estilo underline editorial
   ======================================== */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.auth-field label {
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-icon {
    position: absolute;
    left: 4px; top: 50%; transform: translateY(-50%);
    font-size: 12px;
    color: var(--muted);
    pointer-events: none;
    transition: color 0.25s ease;
    width: 16px;
    text-align: center;
}

.auth-input {
    width: 100%;
    padding: 10px 32px 10px 26px;
    background: transparent;
    border: none;
    border-bottom: 1.5px solid var(--border-mid);
    border-radius: 0;
    color: var(--white);
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    transition: border-color 0.25s ease;
    -webkit-tap-highlight-color: transparent;
    caret-color: var(--cyan);
}

.auth-input:focus {
    outline: none;
    border-bottom-color: var(--cyan);
}

.auth-input-wrap:focus-within .auth-input-icon {
    color: var(--cyan);
}

.auth-input::placeholder {
    color: rgba(61, 84, 112, 0.8);
    font-weight: 300;
}

/* Mata o fundo branco do autofill do browser */
.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--panel) inset !important;
    -webkit-text-fill-color: var(--white) !important;
    border-bottom-color: var(--border-mid) !important;
    transition: background-color 9999s ease-in-out 0s;
}

/* Toggle senha */
.auth-input-toggle {
    position: absolute;
    right: 0; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer;
    color: var(--muted); font-size: 12px;
    transition: color 0.25s ease; padding: 4px;
}
.auth-input-toggle:hover { color: var(--cyan); }

/* Lembrar + esqueci */
.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: -4px;
}

.auth-checkbox-wrap {
    display: flex; align-items: center; gap: 8px; cursor: pointer;
}

.auth-checkbox-wrap input[type="checkbox"] {
    width: 14px; height: 14px;
    accent-color: var(--cyan);
    cursor: pointer;
}

.auth-checkbox-label {
    font-size: 12px; color: var(--muted-2); user-select: none;
}

.auth-forgot {
    font-size: 12px;
    color: var(--muted-2);
    transition: color 0.25s ease;
}
.auth-forgot:hover { color: var(--cyan); }

/* ========================================
   06 — BOTÃO SUBMIT
   ======================================== */
.auth-submit {
    width: 100%; padding: 14px 24px;
    background: var(--cyan);
    color: #020810;
    border: none; border-radius: 4px;
    font-size: 11px; font-weight: 800;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    letter-spacing: 2px;
    text-transform: uppercase;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    transition: all 0.25s var(--ease);
    margin-top: 10px;
    position: relative; overflow: hidden;
}

.auth-submit::before {
    content: '';
    position: absolute; inset: 0;
    background: rgba(255,255,255,0);
    transition: background 0.2s ease;
}
.auth-submit:hover::before { background: rgba(255,255,255,0.1); }

.auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 32px var(--cyan-glow);
}

.auth-submit:active { transform: translateY(0); box-shadow: none; }
.auth-submit i { font-size: 12px; }

.auth-submit.loading { pointer-events: none; opacity: 0.65; }

.auth-spinner {
    display: none;
    width: 15px; height: 15px;
    border: 2px solid rgba(2,8,16,0.25);
    border-top-color: #020810;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.auth-submit.loading .auth-spinner   { display: block; }
.auth-submit.loading .auth-submit-text { display: none; }

/* ========================================
   07 — DIVISOR & FOOTER
   ======================================== */
.auth-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 6px 0;
}

.auth-divider-line {
    flex: 1; height: 1px;
    background: rgba(255,255,255,0.05);
}

.auth-divider span {
    font-size: 10px; color: var(--muted);
    white-space: nowrap; font-weight: 600;
    letter-spacing: 1.5px; text-transform: uppercase;
}

.auth-form-footer {
    margin-top: 22px;
    text-align: center;
    font-size: 13px;
    color: var(--muted-2);
}

.auth-form-footer a {
    color: var(--cyan);
    font-weight: 600;
    opacity: 0.85;
    transition: opacity 0.2s;
}
.auth-form-footer a:hover { opacity: 1; }

/* ========================================
   08 — ALERTAS
   ======================================== */
.auth-alert {
    padding: 12px 15px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
    animation: fadeInUp 0.4s var(--ease) forwards;
    margin-bottom: 6px;
}

.auth-alert i { font-size: 13px; flex-shrink: 0; margin-top: 1px; }

.auth-alert.error {
    background: rgba(255,77,109,0.07);
    border: 1px solid rgba(255,77,109,0.18);
    color: #ffaab8;
}
.auth-alert.error i { color: var(--red); }

.auth-alert.success {
    background: rgba(30,240,139,0.07);
    border: 1px solid rgba(30,240,139,0.18);
    color: #86efac;
}
.auth-alert.success i { color: var(--green); }

/* ========================================
   09 — FORÇA DA SENHA
   ======================================== */
.auth-strength { margin-top: 8px; }

.auth-strength-bars { display: flex; gap: 4px; margin-bottom: 5px; }

.auth-strength-bar {
    flex: 1; height: 2px; border-radius: 10px;
    background: rgba(255,255,255,0.05);
    transition: background 0.3s ease;
}
.auth-strength-bar.active-1 { background: var(--red); }
.auth-strength-bar.active-2 { background: #f59e0b; }
.auth-strength-bar.active-3 { background: #22d3ee; }
.auth-strength-bar.active-4 { background: var(--green); }

.auth-strength-label { font-size: 11px; color: var(--muted); font-weight: 500; }

/* ========================================
   10 — TERMOS
   ======================================== */
.auth-terms { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }

.auth-terms input[type="checkbox"] {
    width: 14px; height: 14px;
    accent-color: var(--cyan);
    flex-shrink: 0; margin-top: 2px; cursor: pointer;
}

.auth-terms-text { font-size: 12px; color: var(--muted-2); line-height: 1.5; user-select: none; }
.auth-terms-text a { color: var(--cyan); font-weight: 500; opacity: 0.85; transition: opacity 0.2s; }
.auth-terms-text a:hover { opacity: 1; }

/* ========================================
   11 — KEYFRAMES
   ======================================== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-22px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ========================================
   12 — RESPONSIVO
   ======================================== */
@media (max-width: 960px) {
    .auth-visual { display: none; }
    .auth-form-side {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        border: none;
        border-top: 1.5px solid var(--border);
        min-height: 100vh;
        margin: 0;
        box-shadow: none;
    }
    .auth-form-wrapper { max-width: 440px; }
}

@media (max-width: 480px) {
    .auth-form-side { padding: 48px 24px; }
    .auth-form-title { font-size: 22px; }
    .auth-row { flex-direction: column; align-items: flex-start; gap: 10px; }
}