/* ============================================
   COACH — Auth Pages (Login/Cadastro)
   Design System: Beto Junior Personal
   ============================================ */

:root {
    --accent: #6AD1DB;
    --accent-hover: #4A9299;
    --accent-glow: rgba(106, 209, 219, 0.4);
    --dark: #1C1C1E;
    --dark-lighter: #2A2A2C;
    --dark-input: #1C1C1E;
    --bg-white: #FFFFFF;
    --text-primary: #000000;
    --text-secondary: #565656;
    --text-on-dark: #FFFFFF;
    --text-on-dark-muted: rgba(255, 255, 255, 0.6);
    --text-on-dark-subtle: rgba(255, 255, 255, 0.35);
    --border-input: rgba(255, 255, 255, 0.1);
    --border-card: rgba(255, 255, 255, 0.06);
    --error: #FF5757;
    --error-glow: rgba(255, 87, 87, 0.15);
    --gold: #F2B705;
    --font-primary: 'Barlow', sans-serif;
    --font-secondary: 'Roboto', sans-serif;
    --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-primary);
    font-weight: 400;
    color: var(--text-on-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

button, input {
    font-family: inherit;
    font-size: inherit;
    border: none;
    outline: none;
}

/* --- Auth Page Layout --- */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--dark);
    position: relative;
    overflow: hidden;
    padding: 40px 20px;
}

.auth-page::before {
    content: '';
    position: absolute;
    top: -40%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(106, 209, 219, 0.05) 0%, transparent 60%);
    pointer-events: none;
}

/* --- Logo --- */
.auth-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    margin-bottom: 40px;
    animation: authFadeIn 0.5s ease;
}

.auth-logo-icon {
    height: 42px;
    width: auto;
}

.auth-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.auth-logo-name {
    font-family: var(--font-primary);
    font-size: 1.2rem;
    color: #fff;
    letter-spacing: 0.5px;
}

.auth-logo-name strong {
    font-weight: 800;
    font-style: normal;
}

.auth-logo-name em {
    font-weight: 400;
    font-style: italic;
    color: var(--gold);
}

.auth-logo-sub {
    font-family: var(--font-primary);
    font-size: 0.5rem;
    color: var(--text-on-dark-subtle);
    letter-spacing: 3px;
    font-weight: 400;
}

/* --- Auth Card --- */
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--dark-lighter);
    border: 1px solid var(--border-card);
    border-radius: 20px;
    padding: 36px 28px;
    animation: authSlideUp 0.5s ease;
}

.auth-card-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-card-header h1 {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 6px;
}

.auth-card-header p {
    font-family: var(--font-secondary);
    font-size: 0.875rem;
    color: var(--text-on-dark-muted);
}

/* --- Error Message --- */
.auth-error {
    display: none;
    background: var(--error-glow);
    border: 1px solid rgba(255, 87, 87, 0.3);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 0.8125rem;
    color: var(--error);
    text-align: center;
    animation: authShake 0.4s ease;
}

.auth-error.visible {
    display: block;
}

/* --- Form --- */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* --- Input Group --- */
.auth-input-group {
    position: relative;
}

.auth-input-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-on-dark-muted);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

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

.auth-input-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-on-dark-subtle);
    pointer-events: none;
    transition: color var(--transition);
}

.auth-input {
    width: 100%;
    background: var(--dark-input);
    border: 1.5px solid var(--border-input);
    border-radius: 12px;
    padding: 14px 16px 14px 44px;
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 400;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.auth-input::placeholder {
    color: var(--text-on-dark-subtle);
}

.auth-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(106, 209, 219, 0.1);
}

.auth-input:focus ~ .auth-input-icon,
.auth-input:focus + .auth-input-icon {
    color: var(--accent);
}

.auth-input-wrapper:focus-within .auth-input-icon {
    color: var(--accent);
}

.auth-input.error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px var(--error-glow);
}

.auth-input-wrapper:has(.auth-input.error) .auth-input-icon {
    color: var(--error);
}

/* --- Password Toggle --- */
.auth-toggle-password {
    position: absolute;
    right: 14px;
    background: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-on-dark-subtle);
    transition: color var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-toggle-password:hover {
    color: var(--text-on-dark-muted);
}

.auth-toggle-password svg {
    width: 18px;
    height: 18px;
}

.auth-toggle-password .icon-eye-off {
    display: none;
}

.auth-toggle-password.active .icon-eye {
    display: none;
}

.auth-toggle-password.active .icon-eye-off {
    display: block;
}

/* --- Submit Button --- */
.auth-btn {
    width: 100%;
    background: var(--accent);
    color: var(--dark);
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 1rem;
    padding: 15px 24px;
    border-radius: 9999px;
    cursor: pointer;
    transition: all var(--transition);
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
}

.auth-btn:hover {
    background: var(--accent-hover);
    color: #fff;
    transform: translateY(-1px);
}

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

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

.auth-btn .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(28, 28, 30, 0.3);
    border-top-color: var(--dark);
    border-radius: 50%;
    animation: authSpin 0.6s linear infinite;
}

.auth-btn.loading .btn-text {
    display: none;
}

.auth-btn.loading .spinner {
    display: block;
}

/* --- Footer Links --- */
.auth-card-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-card);
}

.auth-card-footer p {
    font-size: 0.8125rem;
    color: var(--text-on-dark-subtle);
}

.auth-card-footer a {
    color: var(--accent);
    font-weight: 600;
    transition: color var(--transition);
}

.auth-card-footer a:hover {
    color: var(--accent-hover);
}

/* --- Page Footer --- */
.auth-page-footer {
    margin-top: 40px;
    text-align: center;
    animation: authFadeIn 0.5s ease 0.2s both;
}

.auth-page-footer p {
    font-size: 0.6875rem;
    color: var(--text-on-dark-subtle);
}

.auth-page-footer a {
    color: var(--text-on-dark-muted);
    transition: color var(--transition);
}

.auth-page-footer a:hover {
    color: var(--accent);
}

/* --- Animations --- */
@keyframes authFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes authSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes authShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

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

/* --- Desktop --- */
@media (min-width: 768px) {
    .auth-card {
        padding: 44px 40px;
    }

    .auth-card-header h1 {
        font-size: 1.625rem;
    }

    .auth-logo-icon {
        height: 48px;
    }

    .auth-logo-name {
        font-size: 1.4rem;
    }

    .auth-logo-sub {
        font-size: 0.575rem;
        letter-spacing: 3.5px;
    }
}
