/**
 * Theriand - Auth Pages Stylesheet
 * Login, Register, Forgot/Reset Password
 */

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-primary: #0a0a0f;
    --bg-card: #12121a;
    --bg-input: #1a1a28;
    --border: rgba(139, 92, 246, 0.15);
    --border-focus: rgba(139, 92, 246, 0.5);
    --text-primary: #f0f0f5;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent: #8b5cf6;
    --accent-hover: #7c3aed;
    --accent-glow: rgba(139, 92, 246, 0.3);
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ===== Animated Background ===== */
.auth-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: orbFloat 20s ease-in-out infinite;
}

.bg-orb-1 {
    width: 600px;
    height: 600px;
    background: #8b5cf6;
    top: -200px;
    left: -100px;
    animation-delay: 0s;
}

.bg-orb-2 {
    width: 400px;
    height: 400px;
    background: #6d28d9;
    bottom: -100px;
    right: -50px;
    animation-delay: -7s;
}

.bg-orb-3 {
    width: 300px;
    height: 300px;
    background: #4f46e5;
    top: 50%;
    left: 50%;
    animation-delay: -14s;
}

@keyframes orbFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(50px, -30px) scale(1.1);
    }

    50% {
        transform: translate(-20px, 40px) scale(0.95);
    }

    75% {
        transform: translate(30px, 20px) scale(1.05);
    }
}

/* ===== Auth Container ===== */
.auth-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
    animation: cardFadeIn 0.6s ease-out;
}

.auth-card-register {
    max-width: 520px;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Logo ===== */
.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo-img {
    width: 180px;
    height: auto;
    margin-bottom: 12px;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 6px;
}

/* ===== Alert ===== */
.auth-alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.auth-alert.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.auth-alert.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

/* ===== Form ===== */
.auth-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.input-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon>i:first-child {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 14px;
    transition: var(--transition);
    pointer-events: none;
}

.input-icon input {
    width: 100%;
    padding: 14px 14px 14px 42px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font);
    transition: var(--transition);
    outline: none;
}

.input-icon input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-icon input:focus+i,
.input-icon input:focus~i:first-child {
    color: var(--accent);
}

.input-icon input::placeholder {
    color: var(--text-muted);
}

.input-hint {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    padding-left: 4px;
}

/* Toggle Password */
.toggle-password {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    transition: var(--transition);
}

.toggle-password:hover {
    color: var(--accent);
}

/* Password Strength */
.password-strength {
    margin-top: 8px;
}

.strength-bar {
    height: 4px;
    background: var(--bg-input);
    border-radius: 2px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: var(--transition);
}

.strength-text {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 13px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    accent-color: var(--accent);
}

.forgot-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.forgot-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Buttons */
.btn-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    text-align: center;
}

.btn-auth:not(.btn-secondary) {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    color: #fff;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-auth:not(.btn-secondary):hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.btn-auth:not(.btn-secondary):active {
    transform: translateY(0);
}

.btn-auth.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-auth.btn-secondary:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--border-focus);
}

.btn-auth:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-loader {
    display: none;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    gap: 16px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-divider span {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
}

.auth-back {
    text-align: center;
    margin-top: 24px;
}

.auth-back a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.auth-back a:hover {
    color: var(--accent);
}

/* ===== Step Indicator ===== */
.step-indicator {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 28px;
}

.step {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 20px;
    transition: var(--transition);
}

.step span {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-input);
    font-weight: 600;
    font-size: 11px;
}

.step.active {
    color: var(--accent);
    background: rgba(139, 92, 246, 0.1);
}

.step.active span {
    background: var(--accent);
    color: #fff;
}

.step.completed span {
    background: var(--success);
    color: #fff;
}

/* Form Steps */
.form-step {
    display: none;
    animation: stepFadeIn 0.4s ease-out;
}

.form-step.active {
    display: block;
}

@keyframes stepFadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.step-nav {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

.step-nav .btn-auth {
    flex: 1;
}

.step-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
    text-align: center;
}

/* ===== Region Grid ===== */
.region-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.region-card {
    position: relative;
    padding: 16px 14px;
    background: var(--bg-input);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    overflow: hidden;
}

.region-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--region-color);
    opacity: 0.5;
    transition: var(--transition);
}

.region-card:hover {
    border-color: var(--region-color);
    transform: translateY(-2px);
}

.region-card:hover::before {
    opacity: 1;
}

.region-card input {
    display: none;
}

.region-card input:checked~.region-content {
    color: var(--text-primary);
}

.region-card:has(input:checked) {
    border-color: var(--region-color);
    background: rgba(139, 92, 246, 0.05);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.1);
}

.region-card:has(input:checked)::before {
    opacity: 1;
    height: 4px;
}

.region-content {
    position: relative;
    z-index: 1;
}

.region-name {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.region-desc {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

.region-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--region-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    opacity: 0;
    transform: scale(0);
    transition: var(--transition);
}

.region-card:has(input:checked) .region-check {
    opacity: 1;
    transform: scale(1);
}

/* ===== Success State ===== */
.success-state {
    text-align: center;
    padding: 20px 0;
}

.success-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--success);
    animation: successPulse 2s ease-in-out infinite;
}

@keyframes successPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.2);
    }

    50% {
        box-shadow: 0 0 0 15px rgba(16, 185, 129, 0);
    }
}

.success-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--success);
}

.success-state p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ===== Responsive ===== */
@media (max-width: 520px) {
    .auth-card {
        padding: 28px 20px;
        border-radius: 16px;
    }

    .auth-logo-img {
        height: 32px;
    }

    .region-grid {
        grid-template-columns: 1fr;
    }

    .step-indicator {
        gap: 4px;
    }

    .step {
        font-size: 11px;
        padding: 5px 8px;
    }
}