/* Estilos para Autenticação - VITAEFIT */

:root {
    --primary-gold: #EDC259;
    --primary-dark: #212322;
    --secondary-dark: #2a2b2a;
    --text-light: #ffffff;
    --text-gray: #999;
    --error: #dc3545;
    --success: #28a745;
    --border-radius: 15px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

body.auth-page {
    background: #212322 !important;
    background-color: #212322 !important;
    background-image: linear-gradient(135deg, #212322 0%, #1a1b1a 50%, #212322 100%);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    padding: 20px;
    width: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* Fix para iOS - esconder barra de navegação */
    touch-action: pan-y;
    -webkit-tap-highlight-color: transparent;
    align-items: normal !important;
}

/* Fix específico para iOS - garantir background escuro nas telas de auth */
@supports (-webkit-touch-callout: none) {

    html.ios-device body.auth-page,
    html body.auth-page,
    body.auth-page {
        background: #212322 !important;
        background-color: #212322 !important;
        -webkit-background-size: cover;
        background-size: cover;
        min-height: 100vh;
        min-height: -webkit-fill-available;
        width: 100%;
    }

    html:has(body.auth-page),
    html.ios-device:has(body.auth-page) {
        background: #212322 !important;
        background-color: #212322 !important;
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
}

/* Garantir que html também tenha background escuro quando body tem auth-page */
html body.auth-page {
    background: #212322 !important;
    background-color: #212322 !important;
}

/* Override qualquer estilo global que possa estar interferindo */
body.auth-page,
html:has(body.auth-page) {
    background: #212322 !important;
    background-color: #212322 !important;
}

.auth-container {
    max-width: 450px;
    width: 100%;
    margin: 0 auto;
    padding-top: 20px;
}

.auth-back-btn {
    background: rgba(237, 194, 89, 0.1);
    border: 1px solid rgba(237, 194, 89, 0.3);
    color: var(--primary-gold);
    padding: 10px 20px;
    border-radius: 10px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    margin-bottom: 30px;
    font-weight: 500;
}

.auth-back-btn:hover {
    background: rgba(237, 194, 89, 0.2);
    border-color: var(--primary-gold);
    color: var(--primary-gold);
    transform: translateX(-5px);
}

.auth-card {
    background: linear-gradient(135deg, #2a2b2a 0%, #212322 100%);
    border: 1px solid rgba(237, 194, 89, 0.2);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 40px;
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-gold), #f5d878);
}

.auth-logo {
    text-align: center;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.auth-logo-image {
    height: 80px;
    max-width: 180px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.auth-logo-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-gold);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin: 0;
    letter-spacing: 1px;
}

.auth-logo-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-gold), #f5d878);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 40px;
    color: var(--primary-dark);
    box-shadow: 0 5px 20px rgba(237, 194, 89, 0.3);
}

.auth-title {
    font-size: 32px;
    font-weight: bold;
    color: var(--text-light);
    text-align: center;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    color: var(--text-gray);
    text-align: center;
    margin-bottom: 30px;
    font-size: 15px;
}

.auth-form-group {
    margin-bottom: 25px;
    position: relative;
}

.auth-form-label {
    display: block;
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    letter-spacing: 0.3px;
}

.auth-form-label .optional {
    color: var(--text-gray);
    font-weight: 400;
    font-size: 12px;
}

.auth-form-input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(237, 194, 89, 0.2);
    border-radius: 10px;
    color: var(--text-light);
    font-size: 15px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.auth-form-input:focus {
    outline: none;
    border-color: var(--primary-gold);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(237, 194, 89, 0.1);
}

.auth-form-input::placeholder {
    color: var(--text-gray);
    opacity: 0.6;
}

.auth-form-input option {
    background: var(--secondary-dark);
    color: var(--text-light);
}

.auth-form-input.error {
    border-color: var(--error);
    animation: shake 0.5s;
}

.auth-error-message {
    color: var(--error);
    font-size: 13px;
    margin-top: 6px;
    display: none;
    padding-left: 5px;
}

.auth-form-group.error .auth-error-message {
    display: block;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-8px);
    }

    75% {
        transform: translateX(8px);
    }
}

.auth-forgot-link {
    display: block;
    text-align: right;
    color: var(--primary-gold);
    text-decoration: none;
    font-size: 14px;
    margin-top: -10px;
    margin-bottom: 25px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.auth-forgot-link:hover {
    color: #f5d878;
    text-decoration: underline;
}

.auth-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-gold), #f5d878);
    border: none;
    border-radius: 10px;
    color: var(--primary-dark);
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 5px 15px rgba(237, 194, 89, 0.3);
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(237, 194, 89, 0.4);
    background: linear-gradient(135deg, #f5d878, var(--primary-gold));
}

.auth-btn:active {
    transform: translateY(0);
}

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

.auth-btn-loading {
    position: relative;
    color: transparent !important;
}

.auth-btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid var(--primary-dark);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.auth-link {
    text-align: center;
    color: var(--text-light);
    margin-top: 20px;
    font-size: 15px;
}

.auth-link a {
    color: var(--primary-gold);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.auth-link a:hover {
    color: #f5d878;
    text-decoration: underline;
}

/* Progress Steps */
.auth-progress {
    margin-bottom: 30px;
}

.auth-progress-label {
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.auth-progress-bar {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 10px;
}

.auth-progress-step {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    transition: all 0.4s ease;
}

.auth-progress-step.active {
    background: linear-gradient(90deg, var(--primary-gold), #f5d878);
    box-shadow: 0 0 10px rgba(237, 194, 89, 0.5);
}

.auth-form-step {
    display: none;
    animation: fadeInSlide 0.5s ease;
}

.auth-form-step.active {
    display: block;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.auth-nav-buttons {
    display: flex;
    gap: 12px;
    margin-top: 30px;
}

.auth-nav-btn {
    flex: 1;
    padding: 14px;
    border-radius: 10px;
    border: 2px solid rgba(237, 194, 89, 0.3);
    background: rgba(237, 194, 89, 0.1);
    color: var(--primary-gold);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-nav-btn:hover {
    background: rgba(237, 194, 89, 0.2);
    border-color: var(--primary-gold);
    transform: translateY(-2px);
}

.auth-nav-btn-primary {
    background: linear-gradient(135deg, var(--primary-gold), #f5d878);
    border-color: transparent;
    color: var(--primary-dark);
}

.auth-nav-btn-primary:hover {
    background: linear-gradient(135deg, #f5d878, var(--primary-gold));
    transform: translateY(-2px);
}

/* Alert Messages */
.auth-alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    border-left: 4px solid;
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-alert-danger {
    background: rgba(220, 53, 69, 0.15);
    border-color: var(--error);
    color: #ff6b7a;
}

.auth-alert-success {
    background: rgba(40, 167, 69, 0.15);
    border-color: var(--success);
    color: #6bff8f;
}

.auth-alert-info {
    background: rgba(237, 194, 89, 0.15);
    border-color: var(--primary-gold);
    color: var(--primary-gold);
}

/* Password Toggle */
.auth-password-toggle {
    position: absolute;
    right: 15px;
    top: 10px;
    background: none;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    transition: color 0.3s ease;
}

.auth-password-toggle:hover {
    color: var(--primary-gold);
}

/* Responsive */
@media (max-width: 480px) {
    .auth-card {
        padding: 30px 20px;
    }

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

    .auth-logo-image {
        height: 80px;
        max-width: 140px;
    }

    .auth-logo-title {
        font-size: 1.5rem;
    }

    .auth-logo-icon {
        width: 60px;
        height: 60px;
        font-size: 30px;
    }
}