:root {
    --primary: #04a6e1;
    --primary-dark: #0289c7;
    --dark: #000822;
    --dark-soft: #00030e;
    --bg: #f6f6f6;
    --white: #ffffff;
    --text: #000822;
    --text-muted: #5c5c5c;
    --text-light: #898989;
    --border: #e5e5e5;
    --success: #10b981;
    --error: #ef4444;
    --info: #3b82f6;
    --radius: 16px;
    --radius-full: 500px;
    --shadow: 0 8px 32px rgba(0, 8, 34, 0.08);
    --transition: 0.3s ease;
}

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

body.auth-page {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

.auth-bg-pattern {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(4, 166, 225, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 8, 34, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.auth-main {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--white);
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(4, 166, 225, 0.1);
}

.auth-card--wide {
    max-width: 560px;
}

.auth-card--result {
    text-align: center;
}

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

.auth-logo-link {
    display: inline-block;
    margin-bottom: 20px;
}

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

.auth-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark-soft);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    font-size: 16px;
    color: var(--text-muted);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
}

.form-input {
    width: 100%;
    background: var(--white);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 14px 18px;
    font-family: inherit;
    font-size: 15px;
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input::placeholder {
    color: var(--text-light);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 3px rgba(4, 166, 225, 0.15);
}

.form-input:invalid:not(:placeholder-shown) {
    border-color: var(--error);
}

.input-password-wrap {
    position: relative;
}

.input-password-wrap .form-input {
    padding-right: 48px;
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color var(--transition);
}

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

.form-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: -8px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border: 2px solid var(--primary);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(4, 166, 225, 0.35);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-full {
    width: 100%;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.btn-link:hover {
    color: var(--primary-dark);
}

.btn-loader {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.alert {
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.auth-footer-text {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-link:hover {
    text-decoration: underline;
}

.resend-section {
    text-align: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-muted);
}

.auth-result-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.auth-result-icon--success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.auth-result-icon--error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

@media (max-width: 640px) {
    .auth-card {
        padding: 28px 24px;
        border-radius: 20px;
    }

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

    .form-row {
        grid-template-columns: 1fr;
    }
}
