@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

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

:root {
    --bg-main: #f3f4f6;
    --primary: #6d28d9;
    --primary-hover: #5b21b6;
    --accent: #8b5cf6;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --bg-paper: #ffffff;
    --success: #22c55e;
    --error: #ef4444;
}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-main);
    /* Subtle premium background */
    background-image:
        radial-gradient(at 0% 0%, rgba(109, 40, 217, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.08) 0px, transparent 50%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Back Link */
.back-home {
    position: absolute;
    top: 24px;
    left: 24px;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: color 0.2s;
    font-size: 0.95rem;
}

.back-home:hover {
    color: var(--primary);
}

/* Auth Card */
.main-container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.auth-card {
    background: var(--bg-paper);
    border-radius: 20px;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

/* Header */
.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    height: 48px;
    width: auto;
    margin-bottom: 20px;
}

.auth-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

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

/* Tabs */
.auth-tabs {
    display: flex;
    background: #f3f4f6;
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 32px;
}

.tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px;
    border-radius: 10px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 0.95rem;
}

.tab-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Forms */
.auth-form-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.auth-form-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-main);
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
    transition: color 0.2s;
}

.form-control {
    width: 100%;
    padding: 12px 16px 12px 48px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s;
    background: #ffffff;
    color: var(--text-main);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.1);
}

.form-control:focus+.input-icon,
.form-control:focus~.input-icon {
    color: var(--primary);
}

/* Button */
.btn {
    border-radius: 50px;
    height: 48px;
    font-size: 1rem;
    font-weight: 600;
    text-transform: capitalize;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 32px;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(109, 40, 217, 0.3);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.btn-primary span {
    position: relative;
    z-index: 2;
}

.btn-primary:active,
.btn-primary:focus {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(109, 40, 217, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(109, 40, 217, 0.4);
}

.btn-primary:hover::before {
    opacity: 1;
}

/* Footer / Links */
.form-footer {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 24px;
}

.forgot-link {
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
}

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

.btn-block {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

/* Messages */
.message {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    text-align: center;
    display: none;
}

.message.error {
    background: #fef2f2;
    color: var(--error);
    border: 1px solid #fee2e2;
    display: block;
}

.message.success {
    background: #f0fdf4;
    color: var(--success);
    border: 1px solid #dcfce7;
    display: block;
}

/* Utilities */
.mb-4 {
    margin-bottom: 24px;
}

.pb-3 {
    padding-bottom: 16px;
}

.mt-2 {
    margin-top: 8px;
}

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

.mb-0 {
    margin-bottom: 0;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

/* Switch Toggle Styling */
.switch-btn {
    color: var(--accent);
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

.switch-btn:hover {
    color: var(--primary-hover);
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

/* Social Login */
.social-login-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    color: var(--text-muted);
}

.social-login-divider::before,
.social-login-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}

.social-login-divider:not(:empty)::before {
    margin-right: 16px;
}

.social-login-divider:not(:empty)::after {
    margin-left: 16px;
}

.social-login-divider span {
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-google {
    background: #ffffff;
    color: #444;
    border: 1px solid var(--border);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-google:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.google-icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

/* Mobile */
@media (max-width: 480px) {
    .auth-card {
        padding: 24px;
        background: transparent;
        box-shadow: none;
        border: none;
    }

    .main-container {
        max-width: 100%;
    }
}