/* /css/login.css */

:root {
    --primary-color:  #3b82f6;
    --primary-dark:   #2563eb;
    --primary-light:  #60a5fa;
    --error-color:    #ef4444;
    --success-color:  #10b981;
    --transition:     all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Paleta dark */
    --bg:             #0b1623;
    --panel-r-bg:     rgba(0, 0, 0, 0.45);
    --panel-divider:  rgba(255, 255, 255, 0.06);
    --text-bright:    rgba(255, 255, 255, 0.92);
    --text-mid:       rgba(255, 255, 255, 0.48);
    --text-dim:       rgba(255, 255, 255, 0.28);
    --input-bg:       rgba(255, 255, 255, 0.05);
    --input-border:   rgba(255, 255, 255, 0.13);
    --input-focus-bg: rgba(59, 130, 246, 0.07);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 Helvetica, Arial, sans-serif;
}

body.login-page {
    background: var(--bg);
    color: var(--text-bright);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

/* ============================================================
   GRID PRINCIPAL
   col 1 (55%) = branding | col 2 (45%) = form
   row 1       = conteúdo | row 2       = bottom bar
   ============================================================ */
.login-page-wrapper {
    display: grid;
    grid-template-columns: 55fr 45fr;
    grid-template-rows: 1fr auto;
    min-height: 100vh;
    position: relative;
    background: var(--bg);
}

/* ============================================================
   CANVAS — posição absoluta, cobre o wrapper inteiro
   ============================================================ */
#particle-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ============================================================
   PAINEL ESQUERDO — BRANDING
   ============================================================ */
.login-branding-panel {
    grid-column: 1;
    grid-row: 1;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 4rem;
}

.branding-content {
    max-width: 540px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fade-up 0.85s ease both;
}

/* ============================================================
   FRASE ANIMADA — hero
   ============================================================ */
.brand-headline {
    margin-bottom: 3.5rem;
    line-height: 1.15;
}

.phrase-prefix {
    display: block;
    font-size: clamp(2.4rem, 4vw, 3.4rem);
    font-weight: 300;
    color: rgba(255, 255, 255, 0.70);
    margin-bottom: 0.08em;
}

.phrase-suffix-wrapper {
    position: relative;
    display: inline-block;
}

.phrase-crossed {
    display: inline-block;
    position: relative;
    font-size: clamp(3rem, 5.2vw, 4.6rem);
    font-weight: 800;
    color: var(--primary-light);
    letter-spacing: -1px;
    animation: text-fade-out 0.4s ease-in 2.6s forwards;
}

.strike-line {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 4px;
    width: 0;
    background: var(--primary-color);
    border-radius: 3px;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.75);
    animation: strike-draw 0.55s cubic-bezier(0.4, 0, 0.2, 1) 1.7s forwards;
}

.phrase-replacement {
    position: absolute;
    left: 50%;
    top: 0;
    font-size: clamp(3rem, 5.2vw, 4.6rem);
    font-weight: 800;
    color: var(--primary-light);
    letter-spacing: -1px;
    white-space: nowrap;
    opacity: 0;
    animation: swap-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) 3.0s forwards;
}

@keyframes strike-draw   { to { width: 100%; } }
@keyframes text-fade-out { to { opacity: 0.02; } }
@keyframes swap-in {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============================================================
   IDENTIDADE DA MARCA
   ============================================================ */
.brand-identity {
    display: flex;
    justify-content: center;
    margin-top: 6rem;
    margin-bottom: 9rem;
    animation: fade-up 0.85s ease both;
}

.brand-logo-img {
    max-width: 88%;
    max-height: 260px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 6px 24px rgba(0, 0, 0, 0.5));
}

/* ============================================================
   PAINEL DIREITO — FORMULÁRIO
   ============================================================ */
.login-form-panel {
    grid-column: 2;
    grid-row: 1;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4rem 4.5rem 2.5rem;
    background: var(--panel-r-bg);
    border-left: 1px solid var(--panel-divider);
    animation: fade-up 0.85s ease 0.12s both;
}

/* Bloco único que centraliza todo o conteúdo do painel direito */
.form-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 340px;
}

/* 1. Nome do polo (acima da logo) */
.polo-info {
    text-align: center;
    margin-bottom: 0.5rem;
    width: 100%;
}

.polo-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* 2. Logo do polo (abaixo do nome, acima dos campos) */
.polo-logo-wrap {
    text-align: center;
    margin-bottom: 2rem;
    width: 100%;
}

.form-logo-img {
    max-height: 160px;
    max-width: 160px;
    object-fit: contain;
    filter: drop-shadow(0 3px 12px rgba(0, 0, 0, 0.5));
}

.form-logo-text {
    font-size: 1.6rem;
    font-weight: 700;
    color: white;
    letter-spacing: 2px;
}
.form-logo-text span { font-weight: 300; opacity: 0.65; }

/* 3. Formulário ocupa a largura total do bloco */
.form-main form,
.form-main #message {
    width: 100%;
}

/* ============================================================
   CAMPOS — label estático acima (estilo FIAP)
   ============================================================ */
.field-group {
    margin-bottom: 1.5rem;
}

.field-label {
    display: block;
    font-size: 0.67rem;
    font-weight: 600;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: var(--text-mid);
    margin-bottom: 0.5rem;
}

.field-group > input,
.password-wrapper > input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    font-size: 0.95rem;
    color: var(--text-bright);
    transition: var(--transition);
    letter-spacing: 0.2px;
}

.field-group > input          { padding: 0.85rem 1rem; }
.password-wrapper > input     { padding: 0.85rem 3rem 0.85rem 1rem; }

.field-group > input::placeholder    { color: var(--text-dim); letter-spacing: 0.5px; }
.password-wrapper > input::placeholder { color: var(--text-dim); letter-spacing: 3px; }

.field-group > input:hover,
.password-wrapper > input:hover {
    border-color: rgba(255, 255, 255, 0.24);
}

.field-group > input:focus,
.password-wrapper > input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--input-focus-bg);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.13);
}

/* Wrapper do campo de senha (toggle dentro) */
.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-mid);
    transition: var(--transition);
    padding: 0.2rem;
    line-height: 1;
    font-size: 0.95rem;
}
.password-toggle:hover { color: var(--text-bright); }

/* ============================================================
   BOTÃO LOGIN
   ============================================================ */
.btn-login {
    width: 100%;
    padding: 0.9rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 50%, var(--primary-dark) 100%);
    background-size: 200% 200%;
    background-position: left center;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: background-position 0.5s ease, transform 0.2s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    margin-top: 2rem;
    animation: btn-pulse 3s ease-in-out infinite;
}

/* Reflexo de luz animado */
.btn-login::before {
    content: '';
    position: absolute;
    top: 0; left: -60%;
    width: 40%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transform: skewX(-20deg);
    animation: btn-shimmer 3s ease-in-out infinite;
    pointer-events: none;
}

/* Seta que desliza no hover */
.btn-arrow {
    font-size: 0.8rem;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.btn-login:hover {
    background-position: right center;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.45);
    animation: none;
}
.btn-login:hover .btn-arrow   { opacity: 1; transform: translateX(0); }
.btn-login:hover::before      { animation: none; opacity: 0; }
.btn-login:active             { transform: translateY(0) scale(0.98); }

/* Loading */
.btn-login .spinner {
    display: none;
    width: 18px; height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}
.btn-login.loading .spinner    { display: block; }
.btn-login.loading span,
.btn-login.loading .btn-arrow  { display: none; }
.btn-login.loading             { animation: none; cursor: not-allowed; opacity: 0.8; }

@keyframes btn-pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(59, 130, 246, 0.30); }
    50%       { box-shadow: 0 6px 28px rgba(59, 130, 246, 0.55); }
}
@keyframes btn-shimmer {
    0%        { left: -60%; opacity: 0; }
    20%, 60%  { opacity: 1; }
    80%, 100% { left: 120%; opacity: 0; }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   MENSAGEM ERRO / SUCESSO
   ============================================================ */
#message {
    margin-top: 1rem;
    padding: 10px 14px;
    border-radius: 6px;
    text-align: center;
    font-size: 0.87rem;
    font-weight: 500;
    display: none;
    animation: fade-up 0.4s ease;
}
#message.error   { display:block; background:rgba(239,68,68,0.12);  color:#fca5a5; border:1px solid rgba(239,68,68,0.3); }
#message.success { display:block; background:rgba(16,185,129,0.12); color:#6ee7b7; border:1px solid rgba(16,185,129,0.3); }

/* ============================================================
   BOTTOM BAR — ocupa toda a largura (grid-column: 1 / -1)
   ============================================================ */
.login-bottom-bar {
    grid-column: 1 / -1;
    grid-row: 2;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.9rem 2rem;
    border-top: 1px solid var(--panel-divider);
    background: rgba(0, 0, 0, 0.14);
}

.bottom-text {
    font-size: 0.77rem;
    color: var(--text-dim);
}

.whatsapp-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-mid);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
}
.whatsapp-link:hover              { color: var(--primary-light); background: rgba(59,130,246,0.08); }
.whatsapp-link .fab.fa-whatsapp   { color: var(--primary-color); font-size: 1rem; }

/* ============================================================
   ANIMAÇÕES GLOBAIS
   ============================================================ */
@keyframes fade-up {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   RESPONSIVO
   ============================================================ */
@media (max-width: 960px) {
    .login-page-wrapper {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
    }
    .login-branding-panel { display: none; }
    .login-form-panel {
        grid-column: 1;
        border-left: none;
        padding: 3rem 2rem 2rem;
    }
    .login-bottom-bar {
        grid-column: 1;
        flex-wrap: wrap;
        gap: 0.5rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .login-form-panel { padding: 2rem 1.5rem 1.5rem; }
    .form-logo-text   { font-size: 1.3rem; }
}
