/* ═══════════════════════════════════════════════════════════════════
   Techviethub — App Stylesheet v2.0
   Thay thế hoàn toàn Tailwind CDN
   ═══════════════════════════════════════════════════════════════════ */

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

/* ─── CSS VARIABLES (DESIGN SYSTEM) ─── */
:root {
    /* Background */
    --bg-primary: #07091A;
    --bg-secondary: #0D1025;
    --bg-card: #131829;
    --bg-input: #1A2038;
    --bg-hover: #1E2645;

    /* Brand Colors */
    --accent-indigo: #4F46E5;
    --accent-indigo-h: #6366F1;
    --accent-green: #10B981;
    --accent-green-h: #34D399;
    --accent-red: #EF4444;
    --accent-yellow: #F59E0B;

    /* Glow Effects */
    --glow-indigo: rgba(79, 70, 229, 0.30);
    --glow-green: rgba(16, 185, 129, 0.25);

    /* Text */
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #475569;

    /* Borders */
    --border: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(255, 255, 255, 0.14);

    /* Gradients */
    --gradient-brand: linear-gradient(135deg, #4F46E5 0%, #10B981 100%);
    --gradient-card: linear-gradient(135deg, rgba(79, 70, 229, 0.06) 0%, rgba(16, 185, 129, 0.06) 100%);

    /* Shadows */
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-btn: 0 4px 20px var(--glow-indigo);
    --shadow-btn-green: 0 4px 20px var(--glow-green);

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* Transitions */
    --transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── RESET & BASE ─── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

/* ─── BACKGROUND DECORATION ─── */
.bg-decoration {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    animation: float 8s ease-in-out infinite alternate;
}

.bg-orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #4F46E5 0%, transparent 70%);
    top: -150px;
    left: -150px;
    animation-delay: 0s;
}

.bg-orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #10B981 0%, transparent 70%);
    bottom: -100px;
    right: -100px;
    animation-delay: 4s;
}

.bg-orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, #6366F1 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 2s;
}

.bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(79, 70, 229, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(79, 70, 229, 0.04) 1px, transparent 1px);
    background-size: 48px 48px;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(20px, 20px) scale(1.08);
    }
}

/* ─── AUTH LAYOUT ─── */
.auth-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.auth-container {
    width: 100%;
    max-width: 440px;
    animation: slideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

/* ─── BRAND LOGO ─── */
.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
}

.brand-logo-icon {
    width: 44px;
    height: 44px;
    background: var(--gradient-brand);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 16px var(--glow-indigo);
    flex-shrink: 0;
}

.brand-logo-text {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
    line-height: 1;
}

.brand-logo-text span {
    color: var(--accent-green);
}

.brand-logo-sub {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 2px;
}

/* ─── AUTH CARD ─── */
.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 40px 36px;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(79, 70, 229, 0.5), transparent);
}

.auth-heading {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 6px;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.auth-heading .highlight {
    color: var(--accent-green);
}

.auth-subheading {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 32px;
}

/* ─── SOCIAL PROOF BAR ─── */
.social-proof {
    display: flex;
    gap: 16px;
    background: rgba(79, 70, 229, 0.06);
    border: 1px solid rgba(79, 70, 229, 0.15);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    margin-bottom: 28px;
}

.social-proof-stat {
    text-align: center;
    flex: 1;
}

.social-proof-stat .num {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-green);
    display: block;
    line-height: 1;
}

.social-proof-stat .lbl {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
    display: block;
}

/* ─── FORM ─── */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 15px;
    pointer-events: none;
    transition: var(--transition);
}

.form-control {
    width: 100%;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px 14px 44px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 400;
    outline: none;
    transition: var(--transition);
    appearance: none;
}

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

.form-control:hover {
    border-color: var(--border-hover);
}

.form-control:focus {
    border-color: var(--accent-indigo);
    background: #1E2645;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.form-control:focus+.input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--accent-indigo);
}

/* Password toggle */
.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 15px;
    transition: var(--transition);
}

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

/* Password strength */
.password-strength {
    margin-top: 8px;
    display: none;
}

.strength-bar {
    height: 3px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 4px;
}

.strength-bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.4s ease, background-color 0.4s ease;
    width: 0%;
}

.strength-label {
    font-size: 11px;
    color: var(--text-muted);
}

/* Form row (for label + link) */
.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.form-link {
    font-size: 12px;
    color: var(--accent-indigo);
    font-weight: 500;
    transition: var(--transition);
}

.form-link:hover {
    color: var(--accent-indigo-h);
    text-decoration: underline;
}

/* Error message */
.form-error {
    font-size: 12px;
    color: var(--accent-red);
    margin-top: 5px;
    display: none;
}

.form-control.is-invalid {
    border-color: var(--accent-red);
}

.form-control.is-invalid~.form-error {
    display: block;
}

/* ─── BUTTONS ─── */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.3px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    user-select: none;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: var(--accent-indigo);
    color: white;
    box-shadow: var(--shadow-btn);
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-indigo-h);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--glow-indigo);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-success {
    background: var(--accent-green);
    color: white;
    box-shadow: var(--shadow-btn-green);
}

.btn-success:hover:not(:disabled) {
    background: var(--accent-green-h);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--glow-green);
}

.btn-success:active:not(:disabled) {
    transform: translateY(0);
}

/* Loading spinner in button */
.btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: none;
}

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

.btn.loading .btn-text {
    display: none;
}

.btn.loading .btn-icon {
    display: none;
}

.btn.loading .btn-spinner {
    display: block;
}

/* ─── DIVIDER ─── */
.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 12px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

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

.auth-footer a {
    color: var(--accent-green);
    font-weight: 600;
    margin-left: 4px;
    transition: var(--transition);
}

.auth-footer a:hover {
    color: var(--accent-green-h);
}

/* ─── ALERT / NOTIFICATION ─── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    display: none;
    margin-bottom: 18px;
    border: 1px solid transparent;
    animation: fadeIn 0.3s ease;
}

.alert.show {
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.25);
    color: #FCA5A5;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.25);
    color: #6EE7B7;
}

.alert-info {
    background: rgba(79, 70, 229, 0.1);
    border-color: rgba(79, 70, 229, 0.25);
    color: #A5B4FC;
}

/* ─── TOAST NOTIFICATION ─── */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-hover);
    border-left: 3px solid var(--accent-green);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 260px;
    max-width: 320px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    animation: toastIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.toast.out {
    animation: toastOut 0.3s ease forwards;
}

.toast-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.toast-action {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 1px;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

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

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(-30px);
    }
}

/* ─── UTILITY ─── */
.mt-4 {
    margin-top: 16px;
}

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

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

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

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

/* ─── RESPONSIVE ─── */
@media (max-width: 480px) {
    .auth-card {
        padding: 28px 20px;
        border-radius: var(--radius-lg);
    }

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

    .social-proof {
        flex-direction: row;
        gap: 8px;
        padding: 10px 14px;
    }

    .social-proof-stat .num {
        font-size: 16px;
    }
}