/* ==================== RESET E BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #0a0a0a;
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ==================== CONTAINER BASE ==================== */
.auth-container {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: fadeIn 0.6s ease-out;
    margin: auto;
}

/* ==================== LOGO ==================== */
.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.logo-text {
    font-size: 24px;
    font-weight: 600;
}

/* ==================== HEADER ==================== */
.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.2;
}

.auth-title .highlight {
    background: linear-gradient(135deg, #062552 0%, #7898f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-subtitle {
    color: #888;
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 10px;
}

/* ==================== FORMULÁRIOS ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #ccc;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background-color: #2a2a2a;
    border: 1px solid #333;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-input:focus {
    outline: none;
    border-color: #6eaeff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input::placeholder {
    color: #666;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

/* ==================== INPUT GROUPS ==================== */
.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 16px;
    z-index: 1;
    pointer-events: none;
}

.input-group .form-input {
    padding-left: 50px;
}

.form-input:focus ~ .input-icon {
    color: #6eaeff;
}

/* ==================== GRUPOS DE SENHA ==================== */
.password-group {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 14px;
    transition: color 0.3s ease;
    padding: 8px;
    z-index: 2;
}

.password-toggle:hover {
    color: #fff;
}

.password-toggle:focus {
    outline: none;
    color: #6eaeff;
}

/* ==================== CHECKBOXES ==================== */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 25px;
}

.checkbox-input {
    width: 18px;
    height: 18px;
    accent-color: #6eaeff;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.checkbox-label {
    font-size: 14px;
    color: #ccc;
    line-height: 1.4;
    cursor: pointer;
}

.checkbox-label a {
    color: #6eaeff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.checkbox-label a:hover {
    color: #764ba2;
}

/* ==================== BOTÕES ==================== */
.btn-primary {
    background: linear-gradient(135deg, #062552 0%, #7898f7 100%);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 8px;
    width: 100%;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 13px -3px rgb(102 148 234 / 30%);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    flex: 1;
    padding: 12px;
    background-color: #2a2a2a;
    border: 1px solid #333;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
}

.btn-secondary:hover {
    background-color: #333;
    border-color: #444;
}

/* ==================== DIVIDERS ==================== */
.divider {
    display: flex;
    align-items: center;
    margin: 25px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #333;
}

.divider-text {
    padding: 0 16px;
    color: #666;
    font-size: 14px;
    white-space: nowrap;
}

/* ==================== SOCIAL BUTTONS ==================== */
.social-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
}

/* ==================== LINKS E NAVEGAÇÃO ==================== */
.auth-link {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #333;
}

.auth-link p {
    color: #888;
    font-size: 14px;
}

.auth-link a {
    color: #6eaeff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.auth-link a:hover {
    color: #764ba2;
}

.back-link {
    color: #888;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.back-link:hover {
    color: #6eaeff;
}

/* ==================== MENSAGENS E ERROS ==================== */
.error-message {
    color: #ff6b6b;
    font-size: 14px;
    margin-top: 8px;
    display: none;
    line-height: 1.4;
}

.success-message {
    color: #51cf66;
    font-size: 14px;
    margin-top: 8px;
    display: none;
    line-height: 1.4;
}

.error-summary {
    background-color: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    color: #ff6b6b;
    font-size: 14px;
    line-height: 1.4;
}

.error-summary ul {
    margin-top: 8px;
    padding-left: 20px;
}

.message-box {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    line-height: 1.4;
}

.message-box.success {
    background-color: rgba(81, 207, 102, 0.1);
    border: 1px solid rgba(81, 207, 102, 0.3);
    color: #51cf66;
}

.message-box.error {
    background-color: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #ff6b6b;
}

.message-box.info {
    background-color: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: #6eaeff;
}

/* ==================== SEÇÕES DE AJUDA ==================== */
.help-section {
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    background-color: rgba(26, 26, 26, 0.5);
}

.help-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.help-item:last-child {
    margin-bottom: 0;
}

.help-item i {
    color: #6eaeff;
    font-size: 18px;
    margin-top: 2px;
    flex-shrink: 0;
}

.help-content h3 {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.help-content p {
    font-size: 13px;
    color: #888;
    line-height: 1.4;
}

/* ==================== ESTADOS DE CARREGAMENTO ==================== */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: loading 1.5s infinite;
}

/* ==================== ANIMAÇÕES ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ==================== RESPONSIVE APRIMORADO ==================== */

/* Tablets grandes e desktops pequenos (769px - 1024px) */
@media (max-width: 1024px) {
    body {
        padding: 15px;
    }
    
    .auth-container {
        max-width: 450px;
    }
}

/* Tablets em portrait (481px - 768px) */
@media (max-width: 768px) {
    body {
        padding: 10px;
        align-items: flex-start;
        padding-top: 20px;
    }

    .auth-container {
        padding: 30px 20px;
        border-radius: 12px;
        max-width: 100%;
        margin: 0;
    }

    .logo {
        margin-bottom: 30px;
        gap: 10px;
    }

    .logo-icon {
        width: 36px;
        height: 36px;
    }

    .logo-text {
        font-size: 22px;
    }

    .auth-title {
        font-size: 24px;
    }

    .auth-subtitle {
        font-size: 14px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .social-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .help-section {
        padding: 16px;
    }

    .divider-text {
        font-size: 13px;
        padding: 0 12px;
    }
}

/* Smartphones em landscape (481px - 767px) */
@media (max-width: 767px) and (orientation: landscape) {
    body {
        align-items: center;
        padding: 10px;
    }
    
    .auth-container {
        padding: 25px 20px;
        max-height: calc(100vh - 20px);
        overflow-y: auto;
    }
    
    .logo {
        margin-bottom: 20px;
    }
    
    .auth-header {
        margin-bottom: 20px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
}

/* Smartphones em portrait (320px - 480px) */
@media (max-width: 480px) {
    body {
        padding: 10px;
        align-items: flex-start;
        padding-top: 15px;
    }

    .auth-container {
        padding: 25px 15px;
        border-radius: 10px;
        min-width: 0;
    }

    .logo {
        margin-bottom: 25px;
        gap: 8px;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
    }

    .logo-text {
        font-size: 20px;
    }

    .auth-header {
        margin-bottom: 25px;
    }

    .auth-title {
        font-size: 22px;
        line-height: 1.1;
    }

    .auth-subtitle {
        font-size: 14px;
        line-height: 1.4;
    }

    .form-input {
        padding: 12px 14px;
        font-size: 16px; /* Evita zoom no iOS */
    }

    .input-group .form-input {
        padding: 12px 14px 12px 45px;
    }

    .input-icon {
        left: 14px;
        font-size: 14px;
    }

    .password-toggle {
        right: 10px;
        padding: 6px;
    }

    .btn-primary {
        padding: 14px 20px;
        font-size: 16px;
        min-height: 48px;
    }

    .btn-secondary {
        padding: 10px;
        font-size: 14px;
        min-height: 40px;
    }

    .checkbox-input {
        width: 16px;
        height: 16px;
    }

    .checkbox-label {
        font-size: 13px;
    }

    .help-item {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        align-items: center;
    }

    .help-item i {
        margin-top: 0;
    }

    .divider {
        margin: 20px 0;
    }

    .divider-text {
        font-size: 12px;
        padding: 0 10px;
    }

    .social-buttons {
        gap: 8px;
        margin-bottom: 20px;
    }

    .auth-link {
        margin-top: 15px;
        padding-top: 15px;
    }

    .auth-link p {
        font-size: 13px;
    }
}

/* Smartphones muito pequenos (até 360px) */
@media (max-width: 360px) {
    .auth-container {
        padding: 20px 12px;
    }

    .auth-title {
        font-size: 20px;
    }

    .auth-subtitle {
        font-size: 13px;
    }

    .form-input {
        padding: 10px 12px;
    }

    .input-group .form-input {
        padding: 10px 12px 10px 40px;
    }

    .input-icon {
        left: 12px;
        font-size: 13px;
    }

    .btn-primary {
        padding: 12px 16px;
        font-size: 15px;
    }

    .help-section {
        padding: 12px;
    }
}

/* Ajustes especiais para telas baixas */
@media (max-height: 600px) {
    body {
        align-items: flex-start;
        padding-top: 10px;
    }
    
    .auth-container {
        margin: 0;
    }
    
    .logo {
        margin-bottom: 20px;
    }
    
    .auth-header {
        margin-bottom: 20px;
    }
}

/* Ajustes para telas muito baixas (landscape mobile) */
@media (max-height: 500px) and (orientation: landscape) {
    .auth-container {
        padding: 15px;
        max-height: calc(100vh - 20px);
        overflow-y: auto;
    }
    
    .logo {
        margin-bottom: 15px;
    }
    
    .auth-header {
        margin-bottom: 15px;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .divider {
        margin: 15px 0;
    }
}

/* Ajustes para dispositivos touch */
@media (hover: none) and (pointer: coarse) {
    .form-input {
        font-size: 16px; /* Evita zoom automático no iOS */
    }
    
    .btn-primary,
    .btn-secondary {
        min-height: 44px; /* Tamanho mínimo recomendado para touch */
    }
    
    .password-toggle {
        min-width: 44px;
        min-height: 44px;
    }
    
    .checkbox-input {
        min-width: 20px;
        min-height: 20px;
    }
}

/* Modo escuro forçado do sistema */
@media (prefers-color-scheme: dark) {
    /* Já está em dark mode, mas pode adicionar ajustes se necessário */
}

/* Redução de movimento para acessibilidade */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Alto contraste para acessibilidade */
@media (prefers-contrast: high) {
    .auth-container {
        border: 2px solid #fff;
    }
    
    .form-input {
        border: 2px solid #666;
    }
    
    .form-input:focus {
        border: 2px solid #6eaeff;
    }
}
