@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    /* Brand Colors */
    --primary: #FF4B00;
    --primary-hover: #FF6220;
    --primary-dark: #D43E00;
    --primary-glow: rgba(255, 75, 0, 0.35);
    --primary-light-bg: rgba(255, 75, 0, 0.12);
    --primary-border: rgba(255, 75, 0, 0.3);

    /* Neutral Dark Palette */
    --bg-main: #0B0C10;
    --bg-surface: #12141C;
    --bg-surface-glass: rgba(18, 20, 28, 0.82);
    --bg-card: #171A24;
    --bg-input: rgba(24, 28, 38, 0.75);
    --bg-input-focus: rgba(28, 33, 46, 0.95);

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-medium: rgba(255, 255, 255, 0.16);
    --border-active: #FF4B00;

    /* Text Colors */
    --text-primary: #FFFFFF;
    --text-secondary: #A0A6B5;
    --text-muted: #656C7D;
    --text-inverse: #0B0C10;

    /* Status Colors */
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;

    /* Shadows & Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    --shadow-card: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 40px rgba(255, 75, 0, 0.07);
    --shadow-btn: 0 8px 24px rgba(255, 75, 0, 0.4);
    --shadow-btn-hover: 0 12px 30px rgba(255, 75, 0, 0.6);

    /* Transitions */
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    padding: 24px 16px;
    background-image: 
        radial-gradient(circle at 10% 15%, rgba(255, 75, 0, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 90% 85%, rgba(255, 75, 0, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(18, 20, 28, 0.5) 0%, transparent 100%);
    background-attachment: fixed;
}

/* Ambient Background Effect */
.bg-ambient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.45;
    animation: floatOrb 12s ease-in-out infinite alternate;
}

.ambient-orb-1 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    top: -100px;
    right: -100px;
}

.ambient-orb-2 {
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, #D43E00 0%, transparent 70%);
    bottom: -80px;
    left: -80px;
    animation-delay: -6s;
}

.ambient-grid {
    position: absolute;
    inset: 0;
    background-size: 40px 40px;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
}

@keyframes floatOrb {
    0% { transform: translateY(0px) scale(1); }
    100% { transform: translateY(35px) scale(1.08); }
}

/* Auth Container */
.auth-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 500px;
    margin: auto;
}

.auth-card {
    background: var(--bg-surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

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

/* Header & Brand */
.brand-header {
    text-align: center;
    margin-bottom: 28px;
}

.brand-logo-link {
    display: inline-block;
    transition: transform 0.3s ease;
    text-decoration: none;
}

.brand-logo-link:hover {
    transform: scale(1.03);
}

.brand-logo {
    max-width: 220px;
    height: auto;
    display: block;
    margin: 0 auto 16px auto;
    filter: drop-shadow(0 4px 12px rgba(255, 75, 0, 0.25));
}

.auth-title {
    font-family: var(--font-heading);
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.auth-subtitle {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Role Selector (Aluno vs Academia) */
.role-selector-container {
    margin-bottom: 24px;
}

.role-selector-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
    text-align: center;
}

.role-toggle-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: rgba(12, 14, 20, 0.6);
    padding: 6px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.role-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.role-toggle-btn i {
    font-size: 1.15rem;
    transition: transform 0.2s ease;
}

.role-toggle-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.role-toggle-btn.active {
    background: var(--primary);
    color: #FFFFFF;
    box-shadow: 0 4px 15px rgba(255, 75, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.15);
}

.role-toggle-btn.active i {
    transform: scale(1.1);
}

/* Role Info Badge */
.role-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-light-bg);
    border: 1px solid var(--primary-border);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    color: #FFA47D;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease;
}

.role-badge i {
    color: var(--primary);
    font-size: 1rem;
}

/* Form Groups & Inputs */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-label .optional {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

.input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
    transition: var(--transition);
    z-index: 2;
}

.form-input {
    width: 100%;
    height: 48px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0 42px 0 42px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: var(--transition);
    outline: none;
}

.form-input::placeholder {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-input:focus {
    background: var(--bg-input-focus);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-input:focus + .input-icon,
.input-container:focus-within .input-icon {
    color: var(--primary);
}

.input-toggle-btn {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 2;
}

.input-toggle-btn:hover {
    color: var(--text-primary);
}

.input-feedback {
    font-size: 0.78rem;
    color: var(--danger);
    margin-top: 2px;
    display: none;
}

.form-group.has-error .form-input {
    border-color: var(--danger);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
}

.form-group.has-error .input-feedback {
    display: block;
}

/* Password Strength Indicator */
.password-strength-container {
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.password-strength-bar {
    height: 4px;
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.password-strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: var(--radius-full);
}

.password-strength-text {
    font-size: 0.74rem;
    color: var(--text-muted);
    text-align: right;
}

/* Checkbox & Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    margin-top: 2px;
}

.custom-checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    color: var(--text-secondary);
}

.custom-checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    width: 18px;
    height: 18px;
    background: var(--bg-input);
    border: 1px solid var(--border-medium);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.custom-checkbox-container input:checked ~ .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.checkmark::after {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 10px;
    color: white;
    display: none;
}

.custom-checkbox-container input:checked ~ .checkmark::after {
    display: block;
}

.custom-checkbox-container:hover .checkmark {
    border-color: var(--primary);
}

.link-action {
    color: #FF7034;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.link-action:hover {
    color: #FFA07A;
    text-decoration: underline;
}

/* Google Sign-in Button & Social Auth */
.google-auth-container {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-google {
    width: 100%;
    height: 48px;
    background: #FFFFFF;
    color: #1F2937;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25), 0 0 20px rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: var(--transition);
    position: relative;
    user-select: none;
    text-decoration: none;
}

.btn-google:hover {
    background: #F3F4F6;
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.15), 0 0 12px rgba(255, 75, 0, 0.2);
    transform: translateY(-2px);
    color: #111827;
}

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

.btn-google .google-icon-svg {
    width: 20px;
    height: 20px;
    display: block;
    flex-shrink: 0;
}

.google-badge-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 75, 0, 0.12);
    border: 1px solid rgba(255, 75, 0, 0.35);
    color: #FF7034;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    align-self: center;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 18px 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-medium), transparent);
}

.auth-divider span {
    padding: 0 14px;
    background: transparent;
}

.gym-info-notice {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #FCD34D;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
}

.gym-info-notice i {
    font-size: 1.05rem;
    color: var(--warning);
    margin-top: 2px;
}

/* Submit Button */
.btn-submit {
    width: 100%;
    height: 50px;
    background: linear-gradient(135deg, var(--primary) 0%, #E63D00 100%);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    box-shadow: var(--shadow-btn);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-submit::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 40%;
    height: 200%;
    background: linear-gradient(
        60deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.25) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(25deg);
    transition: none;
}

.btn-submit:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%);
    box-shadow: var(--shadow-btn-hover);
    transform: translateY(-2px);
}

.btn-submit:hover::after {
    left: 140%;
    transition: all 0.75s ease;
}

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

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

/* Footer Switch Link */
.auth-footer {
    text-align: center;
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-footer .link-bold {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
    margin-left: 4px;
    transition: var(--transition);
}

.auth-footer .link-bold:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Footer Bottom Note */
.page-bottom-note {
    text-align: center;
    margin-top: 24px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.page-bottom-note a {
    color: var(--text-secondary);
    text-decoration: none;
}

.page-bottom-note a:hover {
    color: var(--primary);
}

/* Dynamic Field Switcher Transition */
.role-conditional-field {
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.fade-in-field {
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 360px;
    width: calc(100% - 48px);
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #171A24;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-left: 4px solid var(--primary);
    color: #FFFFFF;
    font-size: 0.88rem;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.show {
    transform: translateX(0);
}

.toast.toast-success {
    border-left-color: var(--success);
}

.toast.toast-danger {
    border-left-color: var(--danger);
}

.toast.toast-warning {
    border-left-color: var(--warning);
}

.toast-icon {
    font-size: 1.1rem;
}

.toast-success .toast-icon { color: var(--success); }
.toast-danger .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }

.toast-content {
    flex: 1;
    line-height: 1.35;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
}

.toast-close:hover {
    color: #FFFFFF;
}

/* Responsive adjustments */
@media (min-width: 1024px) {
    .auth-card {
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }
    .auth-card:hover {
        box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.45);
    }
    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(255, 85, 0, 0.4);
    }
}

@media (max-width: 540px) {
    body {
        padding: 16px 12px;
    }

    .auth-card {
        padding: 26px 18px;
        border-radius: var(--radius-lg);
    }

    .auth-title {
        font-size: 1.40rem;
    }

    .brand-logo {
        max-width: 170px;
    }

    .role-toggle-btn {
        padding: 12px 8px;
        font-size: 0.88rem;
        gap: 6px;
        min-height: 48px;
    }

    .btn-primary,
    .btn-google {
        min-height: 48px;
        font-size: 0.95rem;
    }

    /* Impede o zoom automático no Safari iOS */
    .form-input,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="date"],
    select {
        font-size: 16px !important;
        height: 48px;
    }

    .toast-container {
        top: 14px;
        right: 14px;
        left: 14px;
        width: auto;
    }
}

