/*
|--------------------------------------------------------------------------
| TypeClimb Authentication
| Standalone Authentication Pages
|--------------------------------------------------------------------------
*/

* {
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

html,
body {
    min-height: 100%;
}

body {
    background:
        radial-gradient(
            circle at top,
            rgba(37, 99, 235, 0.08),
            transparent 42%
        ),
        var(--tc-bg);

    color: var(--tc-text);

    display: flex;
    justify-content: center;
    align-items: center;

    min-height: 100vh;
    margin: 0;

    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

/*
|--------------------------------------------------------------------------
| Authentication Container
|--------------------------------------------------------------------------
*/

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

/*
|--------------------------------------------------------------------------
| Authentication Card
|--------------------------------------------------------------------------
*/

.auth-card {
    width: 100%;

    background: var(--tc-surface);

    border: 1px solid var(--tc-border);
    border-radius: 16px;

    padding: 30px;

    box-shadow: var(--tc-shadow-lg);

    color: var(--tc-text);

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        color 0.2s ease;
}

.auth-card h1,
.auth-card h2 {
    text-align: center;

    margin-top: 0;
    margin-bottom: 20px;

    color: var(--tc-text);

    line-height: 1.3;
}

.auth-card h1 {
    font-size: 28px;
}

.auth-card h2 {
    font-size: 24px;
}

/*
|--------------------------------------------------------------------------
| Form
|--------------------------------------------------------------------------
*/

.form-group {
    margin-bottom: 16px;
}

label {
    display: block;

    margin-bottom: 6px;

    color: var(--tc-text-secondary);

    font-weight: 500;
}

.required {
    color: var(--tc-danger);
    margin-left: 2px;
}

/*
|--------------------------------------------------------------------------
| Inputs
|--------------------------------------------------------------------------
*/

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"] {
    width: 100%;

    padding: 10px 12px;

    background: var(--tc-surface-alt);
    color: var(--tc-text);

    border: 1px solid var(--tc-border-strong);
    border-radius: 8px;

    font-size: 15px;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
}

input::placeholder {
    color: var(--tc-text-muted);
}

input[readonly] {
    opacity: 0.85;
    cursor: not-allowed;
}

input:focus {
    border-color: var(--tc-primary);

    outline: none;

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.15);
}

html[data-theme="dark"] input:focus {
    box-shadow:
        0 0 0 3px rgba(96, 165, 250, 0.16);
}

/*
|--------------------------------------------------------------------------
| Password
|--------------------------------------------------------------------------
*/

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 42px;
}

.toggle-password {
    position: absolute;

    top: 50%;
    right: 10px;

    transform: translateY(-50%);

    cursor: pointer;
    user-select: none;

    color: var(--tc-text-muted);
}

.toggle-password:hover {
    color: var(--tc-text);
}

/*
|--------------------------------------------------------------------------
| Checkbox
|--------------------------------------------------------------------------
*/

.checkbox {
    font-size: 14px;
}

.checkbox label {
    display: flex;
    align-items: flex-start;

    gap: 8px;

    line-height: 1.5;
}

.checkbox input[type="checkbox"] {
    margin-top: 4px;
    flex-shrink: 0;
}

/*
|--------------------------------------------------------------------------
| Buttons
|--------------------------------------------------------------------------
*/

.btn {
    width: 100%;

    padding: 10px;

    background: var(--tc-primary);
    color: #ffffff;

    border: none;
    border-radius: 8px;

    font-size: 16px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        transform 0.2s ease,
        opacity 0.2s ease;
    text-decoration: none;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 8px;
}

.btn:hover {
    background: var(--tc-primary-dark);
    color: #ffffff;

    transform: translateY(-1px);
}

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

.btn-primary {
    background: var(--tc-primary);
}

.btn-primary:hover {
    background: var(--tc-primary-dark);
}

.btn-secondary {
    background: var(--tc-text-muted);
}

.btn-secondary:hover {
    background: var(--tc-text-secondary);
}

.google-btn {
    background: var(--tc-primary);
}

.google-btn:hover {
    background: var(--tc-primary-dark);
}

/*
|--------------------------------------------------------------------------
| Text / Links
|--------------------------------------------------------------------------
*/

.divider {
    text-align: center;

    margin: 14px 0;

    font-size: 14px;

    color: var(--tc-text-muted);
}

.switch-text,
.forgot-text {
    text-align: center;

    font-size: 14px;

    color: var(--tc-text-secondary);
}

.switch-text a,
.forgot-text a {
    color: var(--tc-primary);

    text-decoration: none;
}

.switch-text a:hover,
.forgot-text a:hover {
    text-decoration: underline;
}

/*
|--------------------------------------------------------------------------
| Informational Text
|--------------------------------------------------------------------------
*/

#passwordStrength {
    font-size: 13px;

    margin-top: 4px;

    color: var(--tc-text-muted);
}

.info-text {
    text-align: center;

    font-size: 14px;

    color: var(--tc-text-muted);

    margin-bottom: 15px;

    line-height: 1.5;
}

.auth-message {
    text-align: center;

    font-size: 14px;

    color: var(--tc-text-muted);

    line-height: 1.6;

    margin: 0 0 14px;
}

.auth-message strong {
    color: var(--tc-text);
}

/*
|--------------------------------------------------------------------------
| Authentication Status Icon
|--------------------------------------------------------------------------
*/

.auth-icon {
    text-align: center;

    font-size: 46px;

    margin-bottom: 15px;

    color: var(--tc-primary);
}

/*
|--------------------------------------------------------------------------
| Notice
|--------------------------------------------------------------------------
*/

.auth-notice {
    background: var(--tc-surface-alt);

    border: 1px solid var(--tc-border);

    border-radius: 8px;

    padding: 12px;

    margin: 18px 0;

    text-align: center;

    font-size: 13px;

    color: var(--tc-text-muted);

    line-height: 1.5;
}

/*
|--------------------------------------------------------------------------
| Actions
|--------------------------------------------------------------------------
*/

.auth-actions {
    display: flex;
    flex-direction: column;

    gap: 10px;

    margin-top: 20px;
}

.auth-secondary-action {
    text-align: center;

    margin-top: 18px;

    font-size: 14px;
}

.auth-secondary-action a {
    color: var(--tc-primary);

    text-decoration: none;
}

.auth-secondary-action a:hover {
    text-decoration: underline;
}

.auth-help {
    text-align: center;

    font-size: 13px;

    color: var(--tc-text-muted);

    line-height: 1.5;

    margin-top: 20px;
}

/*
|--------------------------------------------------------------------------
| Logout
|--------------------------------------------------------------------------
*/

.logout-btn {
    background-color: var(--tc-danger);

    color: #ffffff;

    border: none;

    padding: 12px 30px;

    border-radius: 8px;

    font-size: 16px;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}

.logout-btn:hover {
    background-color: #b91c1c;

    transform: translateY(-1px);
}

/*
|--------------------------------------------------------------------------
| Small Helper Text
|--------------------------------------------------------------------------
*/

.auth-card small {
    display: block;

    margin-top: 6px;

    color: var(--tc-text-muted);

    font-size: 12px;

    line-height: 1.5;
}

#usernameAvailability {
    margin-top: 6px;

    font-size: 13px;

    color: var(--tc-text-muted);
}

/*
|--------------------------------------------------------------------------
| Focus
|--------------------------------------------------------------------------
*/

.auth-card button:focus-visible,
.auth-card a:focus-visible,
.auth-card input:focus-visible,
.toggle-password:focus-visible {
    outline: 2px solid var(--tc-primary);

    outline-offset: 2px;
}

/*
|--------------------------------------------------------------------------
| Dark Theme
|--------------------------------------------------------------------------
*/

html[data-theme="dark"] body {
    background:
        radial-gradient(
            circle at top,
            rgba(37, 99, 235, 0.14),
            transparent 42%
        ),
        var(--tc-bg);
}

html[data-theme="dark"] .auth-card {
    box-shadow: var(--tc-shadow-lg);
}

html[data-theme="dark"] .btn {
    color: #ffffff;
}

html[data-theme="dark"] .btn:hover {
    color: #ffffff;
}

/*
|--------------------------------------------------------------------------
| Responsive
|--------------------------------------------------------------------------
*/

@media (max-width: 480px) {

    .auth-container {
        padding: 15px;
    }

    .auth-card {
        padding: 20px;
        border-radius: 14px;
    }

    .auth-card h1 {
        font-size: 24px;
    }

    .auth-card h2 {
        font-size: 22px;
    }
}