:root {
    /* Colors */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --input-bg: rgba(15, 23, 42, 0.6);
    --input-border: rgba(255, 255, 255, 0.1);
    --input-focus: #6366f1;
    --error: #ef4444;
    --success: #10b981;
    
    /* Layout */
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Background Animated Shapes */
.background-shapes {
    position: absolute;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: drift 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: #4f46e5;
    top: -100px;
    left: -100px;
}

.shape-2 {
    width: 500px;
    height: 500px;
    background: #ec4899;
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}

.shape-3 {
    width: 300px;
    height: 300px;
    background: #0ea5e9;
    top: 40%;
    left: 40%;
    animation-delay: -10s;
}

@keyframes drift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* Container */
.auth-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
    padding: 20px;
    perspective: 1000px;
}

/* Glassmorphic Card */
.auth-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    padding: 40px 30px;
    position: relative;
    overflow: hidden;
    min-height: 450px;
    display: flex;
    flex-direction: column;
}

/* Steps Transition */
.auth-step {
    position: absolute;
    top: 40px;
    left: 30px;
    right: 30px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(20px);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: calc(100% - 80px);
}

.auth-step.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    height: auto;
}

.auth-step.exit-left {
    transform: translateX(-20px);
}

/* Typography & Headers */
.auth-header {
    margin-bottom: 30px;
    text-align: center;
    position: relative;
}

.auth-header h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 14px;
}

.btn-back {
    position: absolute;
    left: -10px;
    top: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
}

.btn-back:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}

/* Forms & Inputs */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-muted);
}

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

.input-wrapper i {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 14px;
}

.input-wrapper input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    padding: 12px 14px 12px 40px;
    color: var(--text-main);
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.toggle-password {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

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

/* Layout helpers */
.space-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.mt-4 { margin-top: 24px; }

/* Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

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

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

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

.checkmark:after {
    content: "";
    display: none;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

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

/* Links */
a {
    color: var(--primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Buttons */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.39);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--input-border);
    color: var(--text-main);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Loading state */
.btn.loading .btn-text {
    opacity: 0;
}

.btn.loading .loader {
    display: block;
}

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

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

/* Method Selection */
.method-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.method-btn {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    color: var(--text-main);
    width: 100%;
}

.method-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.method-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-right: 16px;
}

.method-details h3 {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 4px;
}

.method-details p {
    font-size: 12px;
    color: var(--text-muted);
}

.method-arrow {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 14px;
}

/* OTP Inputs */
.otp-inputs {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.otp-input {
    width: 45px;
    height: 55px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-main);
    transition: var(--transition);
}

.otp-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.resend-text {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

/* Authenticator */
.qr-container {
    text-align: center;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--input-border);
}

.qr-code {
    border-radius: 8px;
    margin-bottom: 12px;
    background: white;
    padding: 8px;
}

.qr-help {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.auth-code-wrapper i {
    font-size: 18px;
}

.auth-code-input {
    text-align: center;
    font-size: 20px;
    letter-spacing: 4px;
    font-weight: 600;
}

/* Success State */
.success-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px 0;
}

.success-icon-wrapper {
    width: 80px;
    height: 80px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.success-icon {
    font-size: 40px;
    color: var(--success);
}

.success-container h2 {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--text-main);
}

.success-container p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

@keyframes scaleIn {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Responsive */
@media (max-width: 480px) {
    .auth-card {
        border-radius: 0;
        min-height: 100vh;
        border: none;
        justify-content: center;
    }
    
    .auth-container {
        padding: 0;
        max-width: 100%;
    }
    
    .otp-input {
        width: 40px;
        height: 50px;
    }
}
