/* LOGIN.CSS - Estilos da página de login */

#login {
    background: #1E3A5F;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
}

/* Posicionar card e texto no login */
#login .login-container {
    position: absolute;
    left: 50px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

#login .rdc-meaning {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
}

/* ==================== VIDEO DE FUNDO ==================== */

.login-video-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.login-video-bg video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    object-fit: cover;
}

.video-overlay {
    display: none;
}

.login-container {
    width: 100%;
    max-width: 580px;
    position: relative;
    z-index: 1;
}

.login-box {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: 40px 48px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-height: calc(100vh - 30px);
    max-height: calc(100dvh - 30px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.login-box::-webkit-scrollbar {
    width: 4px;
}

.login-box::-webkit-scrollbar-track {
    background: transparent;
}

.login-box::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

/* Logo */
.logo-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.logo-text {
    font-size: 2.5rem;
    font-weight: 600;
    font-style: italic;
    color: white;
    margin: 0;
    line-height: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.logo-waves {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 12px rgba(var(--color-primary-rgb), 0.2));
}

/* Login Title / Saudação */
.login-greeting {
    font-size: 1.4rem;
    font-weight: 600;
    color: white;
    text-align: center;
    margin-bottom: 4px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.login-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.4;
}

/* Logo inline no texto */
.inline-logo {
    height: 1em;
    width: auto;
    vertical-align: middle;
    margin-left: 2px;
}

/* Login Form */
.login-form {
    margin-bottom: 12px;
}

.form-group {
    position: relative;
    margin-bottom: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: var(--font-family);
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.9);
}

.form-group input[type="password"],
.form-group input#password {
    padding-right: 2.5rem;
}

.form-group input:focus {
    outline: none;
    border-color: white;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2);
    background: white;
}

.form-group input::placeholder {
    color: #666;
    font-weight: 400;
}

/* Botão mostrar/ocultar senha */
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.password-toggle:hover {
    opacity: 1;
}

/* Aviso de Caps Lock */
.caps-lock-warning {
    display: none;
    align-items: center;
    gap: 6px;
    background: rgba(255, 152, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    margin-top: 8px;
}

.caps-lock-warning.show {
    display: flex;
}

.caps-lock-warning::before {
    content: '⚠️';
}

/* Form Footer */
.form-footer {
    text-align: right;
    margin-bottom: 10px;
}

.login-forgot {
    text-align: center;
    margin-top: var(--spacing-md);
}

.forgot-password {
    font-size: 0.8rem;
    cursor: pointer;
}

.forgot-password {
    color: white;
    text-decoration: none;
    font-size: var(--font-size-small);
    font-weight: 500;
    transition: opacity 0.2s ease;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.forgot-password:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Login Error */
.login-error {
    background: rgba(239, 83, 80, 0.9);
    border: none;
    color: white;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-small);
    margin-top: var(--spacing-md);
    text-align: center;
}

/* Login Success */
.login-success {
    background: rgba(76, 175, 80, 0.9);
    border: none;
    color: white;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-small);
    margin-top: var(--spacing-md);
    text-align: center;
}

/* Login Divider */
.login-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 16px 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.login-divider span {
    padding: 0 var(--spacing-sm);
}

/* Signup Button Secondary */
.btn-signup {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.btn-signup:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

/* Botão primário */
#login .btn-primary,
#signup .btn-primary {
    padding: 12px;
    font-size: 1rem;
}

/* Signup Section */
#signup {
    background: #0a0a0a;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    padding: 15px;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
}

/* GIF de fundo do cadastro */
.signup-gif-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.signup-gif-bg .signup-gif {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4;
}

/* Texto "Nós somos o significado" */
.rdc-meaning {
    font-family: "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Helvetica Neue", sans-serif;
    font-weight: 600;
    text-align: right;
    color: #fff;
    line-height: 1.1;
    margin: 0;
    padding: 1em;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
}

.rdc-meaning .line {
    display: block;
    margin: 0.1em 0;
}

.rdc-meaning .parens {
    white-space: nowrap;
    font-size: clamp(1.8rem, 4vw, 3.5rem);
    letter-spacing: 0.03em;
    opacity: 0.9;
}

.rdc-meaning .text {
    font-size: clamp(1.3rem, 3vw, 2.5rem);
}

.rdc-meaning .parens.bottom {
    margin-bottom: 0;
}

/* Ajustar container do formulário no signup */
#signup .login-container {
    position: absolute;
    left: 50px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    max-width: 540px;
    width: 100%;
}

/* Texto posicionado à direita */
#signup .rdc-meaning {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
}

/* Ajustar o login-box no signup para caber melhor */
#signup .login-box {
    padding: 32px 40px;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
}

#signup .logo-container {
    margin-bottom: 10px;
}

#signup .logo-text {
    font-size: 2rem;
}

#signup .logo-waves {
    width: 50px;
    height: 50px;
}

#signup .login-title {
    font-size: 0.8rem;
    margin-bottom: 12px;
}

#signup .form-group {
    margin-bottom: 10px;
}

#signup .form-group input {
    padding: 10px 12px;
    font-size: 14px;
}

#signup .btn-login {
    padding: 10px;
    margin-top: 5px;
}

#signup .login-footer {
    padding-top: 10px;
    margin-top: 5px;
}

/* Botão de som do vídeo */
.sound-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
}

.sound-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.sound-toggle:active {
    transform: scale(0.95);
}

.sound-toggle.sound-on {
    background: rgba(var(--color-primary-rgb), 0.6);
}

.sound-toggle svg {
    width: 24px;
    height: 24px;
}

/* Login Footer */
.login-footer {
    text-align: center;
    padding-top: 16px;
    margin-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.login-footer .footer-logo {
    height: 56px;
    width: auto;
    margin-bottom: 8px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.grupo-doca {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 2px 0;
    font-weight: 400;
}

.doca-logo {
    font-weight: 600;
    color: white;
}

.doca-waves {
    font-weight: 300;
}

.version {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

/* ==================== VERIFICAÇÃO DE EMAIL ==================== */

.verification-needed {
    background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
    border: 2px solid #FF9800;
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-top: var(--spacing-lg);
    text-align: center;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.verification-needed .verification-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
}

.verification-needed h3 {
    color: #E65100;
    font-size: 1.25rem;
    margin: 0 0 var(--spacing-md) 0;
}

.verification-needed p {
    color: #5D4037;
    margin: 0 0 var(--spacing-sm) 0;
    font-size: var(--font-size-small);
}

.verification-needed p strong {
    color: #E65100;
}

.verification-needed .btn-secondary {
    background: #FF9800;
    color: white;
    border: none;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    cursor: pointer;
    margin-top: var(--spacing-md);
    transition: all 0.2s ease;
}

.verification-needed .btn-secondary:hover {
    background: #F57C00;
}

.verification-needed .btn-secondary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.verification-needed .btn-secondary.success {
    background: #4CAF50;
}

.verification-needed .btn-secondary.error {
    background: #EF5350;
}

.verification-needed .verification-hint {
    margin-top: var(--spacing-md);
    font-size: var(--font-size-small);
    color: #8D6E63;
    font-style: italic;
}

/* ==================== INDICADOR DE FORÇA DE SENHA ==================== */

.password-strength {
    margin-top: var(--spacing-sm);
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    background: #f8f9fa;
}

.password-strength .strength-bar {
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: var(--spacing-sm);
}

.password-strength .strength-fill {
    height: 100%;
    transition: width 0.3s ease, background 0.3s ease;
    border-radius: 2px;
}

.password-strength.weak .strength-fill {
    width: 25%;
    background: #EF5350;
}

.password-strength.medium .strength-fill {
    width: 60%;
    background: #FF9800;
}

.password-strength.strong .strength-fill {
    width: 100%;
    background: #4CAF50;
}

.password-strength .strength-requirements {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    font-size: 0.75rem;
}

.password-strength .strength-requirements span {
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.password-strength .strength-requirements .passed {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
}

.password-strength .strength-requirements .failed {
    background: rgba(158, 158, 158, 0.1);
    color: #9e9e9e;
}

/* ==================== DARK MODE ==================== */
[data-theme="dark"] .session-modal {
    background: #1e1e1e;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .session-modal h3 {
    color: #e0e0e0;
}

[data-theme="dark"] .session-modal p {
    color: #a0a0a0;
}

[data-theme="dark"] .session-modal-buttons .btn-secondary {
    border-color: #444;
    color: #a0a0a0;
}

[data-theme="dark"] .session-modal-buttons .btn-secondary:hover {
    background: #333;
    color: #e0e0e0;
}

[data-theme="dark"] .password-strength {
    background: #252525;
}

[data-theme="dark"] .password-strength .strength-bar {
    background: #333;
}

[data-theme="dark"] .password-strength .strength-requirements .failed {
    background: rgba(158, 158, 158, 0.15);
    color: #888;
}

/* Responsivo */
/* ==================== RESPONSIVO - TABLET ==================== */
@media (max-width: 968px) {
    #login .login-container,
    #signup .login-container {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        margin: 0 auto;
    }

    #login .rdc-meaning,
    #signup .rdc-meaning {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        text-align: center;
        align-items: center;
        padding: 0.5em;
        margin-bottom: 15px;
    }

    #login,
    #signup {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 15px;
        padding: 15px;
    }

    .rdc-meaning .parens {
        font-size: clamp(1.8rem, 8vw, 3rem);
    }

    .rdc-meaning .text {
        font-size: clamp(1.2rem, 6vw, 2rem);
    }

    #signup .login-box {
        padding: 20px;
    }
}

/* ==================== RESPONSIVO - MOBILE ==================== */
@media (max-width: 480px) {
    #signup {
        padding: 10px;
        gap: 10px;
    }

    #signup .rdc-meaning {
        margin-bottom: 10px;
        padding: 0.3em;
    }

    .rdc-meaning .parens {
        font-size: clamp(1.5rem, 10vw, 2.5rem);
        margin: 0.05em 0;
    }

    .rdc-meaning .text {
        font-size: clamp(1rem, 7vw, 1.5rem);
        margin: 0.05em 0;
    }

    #signup .login-box {
        padding: 16px;
    }

    #signup .form-group input {
        padding: 8px 10px;
        font-size: 14px;
    }

    #signup .login-title {
        font-size: 0.75rem;
        margin-bottom: 12px;
    }

    #login {
        padding: 10px;
    }

    .login-box {
        padding: 16px 14px;
    }

    .logo-container {
        gap: 8px;
        margin-bottom: 8px;
    }

    .logo-text {
        font-size: 1.8rem;
    }

    .logo-waves {
        width: 40px;
        height: 40px;
    }

    .login-greeting {
        font-size: 1rem;
    }

    .login-title {
        font-size: 0.75rem;
        margin-bottom: 10px;
    }

    .form-group {
        margin-bottom: 8px;
    }

    .form-group input {
        padding: 9px 10px;
        font-size: 0.85rem;
    }

    .form-group input[type="password"],
    .form-group input#password {
        padding-right: 2rem;
    }

    .password-toggle {
        font-size: 0.9rem;
        right: 8px;
    }

    .caps-lock-warning {
        font-size: 0.7rem;
        padding: 5px 8px;
        margin-top: 5px;
    }

    .form-footer {
        margin-bottom: 8px;
    }

    .forgot-password {
        font-size: 0.75rem;
    }

    #login .btn-primary,
    #signup .btn-primary,
    .btn-signup {
        padding: 9px;
        font-size: 0.8rem;
    }

    .login-divider {
        margin: 6px 0;
        font-size: 0.7rem;
    }

    .login-footer {
        padding-top: 6px;
        margin-top: 4px;
    }

    .grupo-doca {
        font-size: 0.7rem;
    }

    .version {
        font-size: 0.6rem;
    }

    .verification-needed {
        padding: 12px;
    }

    .verification-needed .verification-icon {
        font-size: 2rem;
    }

    .verification-needed h3 {
        font-size: 1rem;
    }

    .password-strength .strength-requirements {
        flex-direction: column;
        gap: 3px;
    }
}

/* Telas muito pequenas */
@media (max-height: 600px) {
    #login {
        padding: 8px;
    }

    .login-box {
        padding: 14px 12px;
    }

    .logo-container {
        margin-bottom: 6px;
    }

    .logo-text {
        font-size: 1.6rem;
    }

    .logo-waves {
        width: 35px;
        height: 35px;
    }

    .login-greeting {
        font-size: 0.95rem;
    }

    .login-title {
        margin-bottom: 8px;
    }

    .login-footer {
        display: none;
    }
}

/* ==================== MODAIS DE SESSÃO ==================== */

.session-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal, 1050);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.session-modal {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.session-modal .session-modal-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
}

.session-modal h3 {
    margin: 0 0 var(--spacing-md) 0;
    color: var(--color-text);
    font-size: 1.25rem;
}

.session-modal p {
    margin: 0 0 var(--spacing-sm) 0;
    color: var(--color-text-light);
    font-size: var(--font-size-base);
}

.session-modal p strong {
    color: #FF9800;
    font-weight: 600;
}

.session-modal.expired p strong {
    color: #EF5350;
}

.session-modal-buttons {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
    justify-content: center;
}

.session-modal-buttons .btn-primary {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    cursor: pointer;
    transition: all 0.2s ease;
}

.session-modal-buttons .btn-primary:hover {
    background: #5800CC;
}

.session-modal-buttons .btn-secondary {
    background: transparent;
    color: var(--color-text-light);
    border: 1px solid #e0e0e0;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    cursor: pointer;
    transition: all 0.2s ease;
}

.session-modal-buttons .btn-secondary:hover {
    background: #f5f5f5;
    color: var(--color-text);
}

/* ==================== TOAST NOTIFICATIONS ==================== */

.toast-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-weight: 500;
    z-index: var(--z-tooltip, 1070);
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-notification.toast-success {
    background: #4CAF50;
    color: white;
}

.toast-notification.toast-error {
    background: #EF5350;
    color: white;
}

.toast-notification.toast-warning {
    background: #FF9800;
    color: white;
}

.toast-notification.toast-info {
    background: var(--color-primary);
    color: white;
}

/* Responsivo para modais de sessão */
@media (max-width: 480px) {
    .session-modal {
        padding: var(--spacing-lg);
    }

    .session-modal-buttons {
        flex-direction: column;
    }

    .session-modal-buttons button {
        width: 100%;
    }
}