* {
    box-sizing: border-box;
}

:root {
    --primary: #0e91ff;
    --primary-dark: #0969e8;
    --bg-dark: #020a13;
    --bg-card: rgba(4, 14, 25, 0.6);
    --text-light: #d4dbe5;
    --text-muted: #8995a5;
    --border-color: #263445;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: var(--bg-dark);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #fff;
}

/* ============================================
   TELA DE LOGIN - GRID RESPONSIVO
   ============================================ */
.login-screen {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: grid;
    grid-template-columns: 45% 55%;
    overflow: hidden;
    background: radial-gradient(circle at 68% 42%, #071d31 0%, #020a13 52%, #01060d 100%);
}

/* ============================================
   BACKDROP COM POSTERS - CORRIGIDO
   ============================================ */
.backdrop {
    position: absolute;
    inset: 0;
    overflow: hidden;
    opacity: 0.18;
    filter: saturate(0.8);
    pointer-events: none;
}

.poster {
    position: absolute;
    border-radius: 8px;
    background: linear-gradient(145deg, #1c3150, #0b1320 55%, #173f68);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.poster::after {
    content: '';
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(92, 168, 220, 0.2);
    border-radius: 4px;
}

/* Desktop - tamanhos fixos */
.poster {
    width: 160px;
    height: 240px;
}
.p1 { left: -10px; top: 40px; transform: rotate(-9deg); }
.p2 { left: 100px; top: 0; transform: rotate(-4deg); }
.p3 { left: 230px; top: 35px; transform: rotate(7deg); }
.p4 { left: -40px; top: 350px; transform: rotate(6deg); }
.p5 { left: 130px; top: 390px; transform: rotate(-7deg); }
.p6 { left: 310px; top: 330px; transform: rotate(8deg); }

/* Tablets e telas médias */
@media (max-width: 1024px) {
    .poster {
        width: 120px;
        height: 180px;
    }
    .p1 { left: -8px; top: 30px; }
    .p2 { left: 75px; top: -5px; }
    .p3 { left: 170px; top: 25px; }
    .p4 { left: -30px; top: 260px; }
    .p5 { left: 95px; top: 290px; }
    .p6 { left: 230px; top: 245px; }
}

/* Mobile - até 768px */
@media (max-width: 768px) {
    .backdrop {
        opacity: 0.12;
    }
    .poster {
        width: 80px;
        height: 120px;
        border-radius: 6px;
    }
    .poster::after {
        inset: 5px;
    }
    .p1 { left: -10px; top: 20px; transform: rotate(-6deg); }
    .p2 { left: 45px; top: -8px; transform: rotate(-3deg); }
    .p3 { left: 110px; top: 10px; transform: rotate(5deg); }
    .p4 { left: -15px; top: 160px; transform: rotate(4deg); }
    .p5 { left: 55px; top: 180px; transform: rotate(-5deg); }
    .p6 { left: 135px; top: 150px; transform: rotate(6deg); }
}

/* Mobile pequeno - até 480px */
@media (max-width: 480px) {
    .backdrop {
        opacity: 0.10;
    }
    .poster {
        width: 55px;
        height: 82px;
        border-radius: 4px;
    }
    .poster::after {
        inset: 3px;
    }
    .p1 { left: -5px; top: 12px; transform: rotate(-4deg); }
    .p2 { left: 30px; top: -4px; transform: rotate(-2deg); }
    .p3 { left: 70px; top: 5px; transform: rotate(3deg); }
    .p4 { left: -8px; top: 100px; transform: rotate(3deg); }
    .p5 { left: 35px; top: 115px; transform: rotate(-3deg); }
    .p6 { left: 85px; top: 95px; transform: rotate(4deg); }
}

/* Mobile muito pequeno - até 380px */
@media (max-width: 380px) {
    .poster {
        width: 40px;
        height: 60px;
        border-radius: 3px;
    }
    .poster::after {
        inset: 2px;
    }
    .p1 { left: -3px; top: 8px; }
    .p2 { left: 22px; top: -2px; }
    .p3 { left: 50px; top: 3px; }
    .p4 { left: -5px; top: 70px; }
    .p5 { left: 25px; top: 80px; }
    .p6 { left: 60px; top: 65px; }
}

.vignette {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(2, 10, 18, 0.18) 0%, rgba(2, 10, 18, 0.76) 45%, #020a13 62%),
        linear-gradient(0deg, rgba(0, 0, 0, 0.45), transparent 35%, rgba(0, 0, 0, 0.3));
    pointer-events: none;
}

/* ============================================
   BRAND PANEL (ESQUERDA) - REDUZIDO PARA MOBILE
   ============================================ */
.brand-panel {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px 15px 20px;
}

.logo {
    width: min(18vw, 200px);
    height: auto;
    filter: drop-shadow(0 18px 35px rgba(0, 105, 255, 0.24));
}

.wordmark {
    margin-top: 4px;
    font-size: clamp(28px, 3.5vw, 50px);
    font-weight: 900;
    letter-spacing: -3px;
    line-height: 0.9;
}
.wordmark strong:first-child { color: #fff; }
.wordmark strong:last-child { color: var(--primary); }

.tagline {
    margin: 10px 0 20px;
    color: var(--text-light);
    font-size: clamp(11px, 1vw, 16px);
    letter-spacing: 0.2px;
}
.tagline span { color: #1097ff; }

.features {
    width: min(100%, 480px);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.feature {
    text-align: center;
    color: #dce4ef;
    padding: 4px 2px;
}
.feature .ico {
    height: 30px;
    font-size: 20px;
    line-height: 30px;
    color: #0798ff;
    margin-bottom: 2px;
}
.feature .ico i {
    font-size: 20px;
}
.feature b {
    display: block;
    font-size: 10px;
    letter-spacing: 0.3px;
}
.feature small {
    display: block;
    color: var(--text-muted);
    margin-top: 1px;
    font-size: 8px;
}

/* ============================================
   FORM PANEL (DIREITA) - REDUZIDO PARA MOBILE
   ============================================ */
.form-panel {
    position: relative;
    z-index: 2;
    align-self: center;
    width: min(620px, calc(100% - 40px));
    padding: 15px 0 20px;
}

.form-panel h1 {
    font-size: clamp(22px, 2.5vw, 38px);
    margin: 0 0 4px;
    letter-spacing: -1.5px;
}
.form-panel h1 span { color: var(--primary); }

.subtitle {
    color: #aab4c1;
    font-size: clamp(11px, 0.9vw, 15px);
    margin: 0 0 18px;
}

/* ============================================
   CAMPOS DO FORMULÁRIO - REDUZIDOS
   ============================================ */
.field {
    height: 56px;
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-card);
    margin-bottom: 12px;
    transition: 0.2s;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.field.focused,
.field:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px rgba(7, 143, 255, 0.2), 0 0 20px rgba(7, 143, 255, 0.06);
}
.field.error {
    border-color: #ff4444;
    box-shadow: 0 0 0 1px rgba(255, 68, 68, 0.2);
}

.field-icon {
    width: 48px;
    text-align: center;
    font-size: 18px;
    color: #cbd5e2;
    flex-shrink: 0;
}
.field-icon i {
    font-size: 18px;
}

.field input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
    font-size: 15px;
}
.field input::placeholder {
    color: #98a4b4;
}
.field input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px rgba(4, 14, 25, 0.8) inset;
    -webkit-text-fill-color: #fff;
}

.eye {
    border: 0;
    background: none;
    color: #d9e2ed;
    font-size: 18px;
    padding: 12px 16px;
    cursor: pointer;
    flex-shrink: 0;
}

/* ============================================
   BOTÃO PRINCIPAL - REDUZIDO
   ============================================ */
.btn-primary-custom {
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 12px;
    color: white;
    font-size: 15px;
    font-weight: 700;
    background: linear-gradient(100deg, var(--primary-dark), #0699f4);
    box-shadow: 0 8px 20px rgba(7, 143, 255, 0.2);
    transition: 0.2s;
    cursor: pointer;
}
.btn-primary-custom:hover,
.btn-primary-custom:focus {
    transform: scale(1.01);
    box-shadow: 0 8px 25px rgba(7, 143, 255, 0.3);
}
.btn-primary-custom:active {
    transform: scale(0.98);
}
.btn-primary-custom:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   DIVISOR - REDUZIDO
   ============================================ */
.or-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 18px 0 16px;
    color: #aeb8c4;
}
.or-divider span {
    height: 1px;
    flex: 1;
    background: #405060;
}
.or-divider b {
    font-size: 11px;
    font-weight: 500;
    flex-shrink: 0;
}

/* ============================================
   BOTÕES SOCIAIS - REDUZIDOS
   ============================================ */
.social-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn-social {
    height: 48px;
    border: 0;
    border-radius: 12px;
    background: #f6f7f9;
    color: #101419;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: 0.2s;
}
.btn-social:hover {
    filter: brightness(0.96);
    transform: scale(1.01);
}
.btn-social:active {
    transform: scale(0.97);
}
.btn-social:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn-social.google .google-g {
    font-weight: 900;
    font-size: 18px;
    color: #4285f4;
}
.btn-social.google .google-g i {
    font-size: 18px;
}
.btn-social.apple {
    background: #1a1a1a;
    color: #fff;
}
.btn-social.apple .apple-symbol {
    font-size: 18px;
    color: #fff;
}
.btn-social.apple .apple-symbol i {
    font-size: 18px;
}

/* ============================================
   LINKS ADICIONAIS - REDUZIDOS
   ============================================ */
.forgot-link {
    display: block;
    margin: 14px auto 0;
    border: 0;
    background: transparent;
    color: var(--primary);
    font-size: 13px;
    cursor: pointer;
    text-align: center;
    transition: 0.2s;
}
.forgot-link:hover {
    color: #4db8ff;
}
.forgot-link:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.help-text {
    position: fixed;
    right: 30px;
    bottom: 18px;
    color: #9aa6b4;
    font-size: 12px;
    z-index: 5;
}

/* ============================================
   BOTÃO DE IDIOMA - REDUZIDO
   ============================================ */
.language-btn {
    position: fixed;
    z-index: 5;
    right: 30px;
    top: 18px;
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(7, 17, 29, 0.8);
    color: #b9c3ce;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
}
.language-btn:hover {
    border-color: var(--primary);
    color: #fff;
}
.language-btn:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.language-btn .lang-icon {
    font-size: 16px;
}
.language-btn .lang-arrow {
    margin-left: 4px;
}

/* ============================================
   TOAST / NOTIFICAÇÃO
   ============================================ */
.toast-custom {
    position: fixed;
    z-index: 999;
    left: 50%;
    bottom: 20px;
    transform: translate(-50%, 40px);
    opacity: 0;
    padding: 10px 18px;
    border: 1px solid #2e4357;
    border-radius: 10px;
    background: rgba(8, 21, 35, 0.95);
    backdrop-filter: blur(10px);
    color: #fff;
    font-size: 13px;
    transition: 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
    max-width: 90%;
    text-align: center;
}
.toast-custom.show {
    opacity: 1;
    transform: translate(-50%, 0);
}
.toast-custom.error {
    border-color: #ff4444;
}
.toast-custom.success {
    border-color: #00c853;
}

/* ============================================
   LOADING SPINNER
   ============================================ */
.spinner-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2, 10, 18, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 12px;
}
.spinner-overlay.show {
    display: flex;
}
.spinner-overlay .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.spinner-overlay p {
    color: #aab4c1;
    font-size: 14px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   RESPONSIVIDADE - MOBILE PRIORITY
   ============================================ */

/* Tablets e telas médias */
@media (max-width: 1024px) {
    .login-screen {
        grid-template-columns: 40% 60%;
    }
    .brand-panel {
        padding: 25px 12px 15px;
    }
    .logo {
        width: min(20vw, 180px);
    }
    .wordmark {
        font-size: clamp(24px, 3vw, 40px);
    }
    .tagline {
        font-size: clamp(10px, 0.9vw, 14px);
        margin: 8px 0 16px;
    }
    .features {
        gap: 6px;
    }
    .feature .ico {
        height: 26px;
        font-size: 18px;
        line-height: 26px;
    }
    .feature .ico i {
        font-size: 18px;
    }
    .feature b {
        font-size: 9px;
    }
    .feature small {
        font-size: 7px;
    }
    .form-panel {
        width: min(540px, calc(100% - 30px));
        padding: 10px 0 15px;
    }
    .form-panel h1 {
        font-size: clamp(20px, 2.2vw, 32px);
    }
    .subtitle {
        font-size: clamp(10px, 0.8vw, 13px);
        margin-bottom: 14px;
    }
    .field {
        height: 48px;
        border-radius: 10px;
        margin-bottom: 10px;
    }
    .field-icon {
        width: 40px;
        font-size: 16px;
    }
    .field-icon i {
        font-size: 16px;
    }
    .field input {
        font-size: 14px;
    }
    .btn-primary-custom {
        height: 46px;
        font-size: 14px;
        border-radius: 10px;
    }
    .btn-social {
        height: 42px;
        font-size: 12px;
        border-radius: 10px;
        gap: 6px;
    }
    .btn-social.google .google-g i,
    .btn-social.apple .apple-symbol i {
        font-size: 16px;
    }
    .or-divider {
        margin: 14px 0 12px;
        gap: 10px;
    }
    .or-divider b {
        font-size: 10px;
    }
    .forgot-link {
        font-size: 12px;
        margin-top: 10px;
    }
    .language-btn {
        right: 20px;
        top: 14px;
        height: 30px;
        font-size: 11px;
        padding: 0 10px;
        border-radius: 8px;
    }
    .language-btn .lang-icon {
        font-size: 14px;
    }
    .help-text {
        right: 20px;
        bottom: 14px;
        font-size: 11px;
    }
}

/* Mobile - até 768px */
@media (max-width: 768px) {
    .login-screen {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        min-height: 100vh;
        overflow-y: auto;
    }
    
    .brand-panel {
        padding: 16px 16px 8px;
        min-height: 120px;
    }
    .logo {
        width: min(25vw, 120px);
    }
    .wordmark {
        font-size: clamp(20px, 4vw, 32px);
        letter-spacing: -2px;
        margin-top: 2px;
    }
    .tagline {
        font-size: 11px;
        margin: 6px 0 12px;
    }
    .features {
        gap: 4px;
        width: 100%;
        max-width: 100%;
    }
    .feature .ico {
        height: 22px;
        font-size: 14px;
        line-height: 22px;
    }
    .feature .ico i {
        font-size: 14px;
    }
    .feature b {
        font-size: 8px;
    }
    .feature small {
        font-size: 6px;
    }
    
    .form-panel {
        width: calc(100% - 24px);
        padding: 8px 0 12px;
        max-width: 100%;
    }
    .form-panel h1 {
        font-size: clamp(18px, 3.5vw, 26px);
        letter-spacing: -1px;
        margin-bottom: 2px;
    }
    .subtitle {
        font-size: 11px;
        margin-bottom: 12px;
    }
    .field {
        height: 44px;
        border-radius: 8px;
        margin-bottom: 8px;
    }
    .field-icon {
        width: 36px;
        font-size: 14px;
    }
    .field-icon i {
        font-size: 14px;
    }
    .field input {
        font-size: 13px;
    }
    .eye {
        font-size: 16px;
        padding: 10px 12px;
    }
    .btn-primary-custom {
        height: 42px;
        font-size: 13px;
        border-radius: 8px;
    }
    .social-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .btn-social {
        height: 40px;
        font-size: 12px;
        border-radius: 8px;
        gap: 6px;
    }
    .btn-social.google .google-g i,
    .btn-social.apple .apple-symbol i {
        font-size: 14px;
    }
    .or-divider {
        margin: 10px 0 8px;
        gap: 8px;
    }
    .or-divider b {
        font-size: 9px;
    }
    .forgot-link {
        font-size: 11px;
        margin-top: 8px;
    }
    .help-text {
        display: none;
    }
    .language-btn {
        right: 12px;
        top: 10px;
        height: 26px;
        font-size: 10px;
        padding: 0 8px;
        border-radius: 6px;
    }
    .language-btn .lang-icon {
        font-size: 12px;
    }
    .language-btn .lang-arrow {
        margin-left: 2px;
    }
    
    /* Ajuste dos posters para mobile */
    .backdrop .poster {
        width: 70px;
        height: 105px;
    }
    .p1 { left: -5px; top: 10px; }
    .p2 { left: 40px; top: -5px; }
    .p3 { left: 95px; top: 5px; }
    .p4 { left: -10px; top: 140px; }
    .p5 { left: 50px; top: 160px; }
    .p6 { left: 120px; top: 130px; }
}

/* Mobile pequeno - até 480px */
@media (max-width: 480px) {
    .brand-panel {
        padding: 10px 10px 4px;
        min-height: 90px;
    }
    .logo {
        width: min(20vw, 80px);
    }
    .wordmark {
        font-size: clamp(16px, 3vw, 24px);
        letter-spacing: -1.5px;
        margin-top: 0;
    }
    .tagline {
        font-size: 9px;
        margin: 4px 0 8px;
    }
    .features {
        gap: 2px;
    }
    .feature .ico {
        height: 18px;
        font-size: 12px;
        line-height: 18px;
    }
    .feature .ico i {
        font-size: 12px;
    }
    .feature b {
        font-size: 7px;
    }
    .feature small {
        font-size: 5px;
    }
    
    .form-panel {
        width: calc(100% - 16px);
        padding: 4px 0 8px;
    }
    .form-panel h1 {
        font-size: clamp(16px, 3vw, 20px);
    }
    .subtitle {
        font-size: 10px;
        margin-bottom: 8px;
    }
    .field {
        height: 38px;
        border-radius: 6px;
        margin-bottom: 6px;
    }
    .field-icon {
        width: 30px;
        font-size: 12px;
    }
    .field-icon i {
        font-size: 12px;
    }
    .field input {
        font-size: 12px;
    }
    .eye {
        font-size: 14px;
        padding: 8px 10px;
    }
    .btn-primary-custom {
        height: 36px;
        font-size: 12px;
        border-radius: 6px;
    }
    .btn-social {
        height: 34px;
        font-size: 11px;
        border-radius: 6px;
        gap: 4px;
    }
    .btn-social.google .google-g i,
    .btn-social.apple .apple-symbol i {
        font-size: 12px;
    }
    .or-divider {
        margin: 6px 0 4px;
        gap: 6px;
    }
    .or-divider b {
        font-size: 8px;
    }
    .forgot-link {
        font-size: 10px;
        margin-top: 6px;
    }
    .toast-custom {
        font-size: 11px;
        padding: 8px 14px;
        bottom: 12px;
    }
    .language-btn {
        right: 8px;
        top: 8px;
        height: 22px;
        font-size: 9px;
        padding: 0 6px;
        border-radius: 4px;
    }
    .language-btn .lang-icon {
        font-size: 10px;
    }
}

/* ============================================
   SUPORTE PARA SAFE AREA (iOS)
   ============================================ */
@supports (padding: env(safe-area-inset-top)) {
    .login-screen {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    .language-btn {
        top: calc(14px + env(safe-area-inset-top));
        right: calc(16px + env(safe-area-inset-right));
    }
    @media (max-width: 768px) {
        .language-btn {
            top: calc(10px + env(safe-area-inset-top));
            right: calc(12px + env(safe-area-inset-right));
        }
    }
    @media (max-width: 480px) {
        .language-btn {
            top: calc(8px + env(safe-area-inset-top));
            right: calc(8px + env(safe-area-inset-right));
        }
    }
}

/* ============================================
   UTILITÁRIOS
   ============================================ */
.d-none {
    display: none !important;
}
.text-center {
    text-align: center;
}
.w-100 {
    width: 100%;
}
.mt-2 {
    margin-top: 8px;
}
.mb-2 {
    margin-bottom: 8px;
}
.gap-1 {
    gap: 4px;
}
.gap-2 {
    gap: 8px;
}

/* Estilo do botão Microsoft */
.btn-social.microsoft {
    background: #2f2f2f;
    color: #fff;
    border: 1px solid #444;
}

.btn-social.microsoft:hover {
    background: #1a1a1a;
    border-color: #666;
}

.btn-social.microsoft .microsoft-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    font-size: 20px;
}

/* Ícone Microsoft (pode usar SVG) */
.btn-social.microsoft .microsoft-icon i {
    font-size: 20px;
}

/* Se quiser usar SVG customizado */
.btn-social.microsoft .microsoft-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}