/* ═══════════════════════════════════════════════
   login.css
   Desktop  → layout 2 cột (left hero + right form)
   Mobile   → card đơn giản 1 cột
   ═══════════════════════════════════════════════ */

:root {
    --primary:      #22c55e;
    --primary-dark: #16a34a;
    --text-dark:    #1f2937;
    --text-muted:   #6b7280;
    --border:       #e5e7eb;
    --bg-light:     #f9fafb;
}

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

html {
    overflow-x: hidden;
}

body {
    font-family: "Be Vietnam Pro", sans-serif;
    background: linear-gradient(135deg, #e0f2fe 0%, #f0fdf4 100%);
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    width: 100%;
}

/* decorative circles */
body::before {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    background: rgba(34,197,94,0.10);
    border-radius: 50%;
    top: -200px; left: -200px;
    z-index: 0;
}
body::after {
    content: '';
    position: absolute;
    width: 300px; height: 300px;
    background: rgba(59,130,246,0.08);
    border-radius: 50%;
    bottom: -150px; right: -150px;
    z-index: 0;
}

.skyline {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 200px;
    background: linear-gradient(to top, rgba(34,197,94,0.15) 0%, transparent 100%);
    z-index: 0;
}

/* ══════════════════════════════
   DESKTOP – 2-column card
══════════════════════════════ */
.login-container {
    position: relative;
    z-index: 1;
    display: flex;
    max-width: 1100px;
    width: 100%;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.08);
    overflow: hidden;
    min-height: 600px;
}

/* ── Left side ── */
.left-side {
    flex: 1;
    padding: 60px 50px;
    background: linear-gradient(135deg, #f0fdf4 0%, #e0f2fe 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 40px;
}

.logo-icon {
    width: 56px; height: 56px;
    background: var(--primary);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 28px; font-weight: 800;
    box-shadow: 0 4px 12px rgba(34,197,94,0.3);
}

.logo-text {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
}

.welcome-text h1 {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 12px;
    line-height: 1.2;
}
.welcome-text p {
    font-size: 16px;
    color: var(--text-muted);
    line-height: 1.6;
}

.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 40px;
}

.feature-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: transform 0.3s, box-shadow 0.3s;
}
.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
}

.feature-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 10px;
    color: var(--primary);
    font-size: 20px;
}
.feature-card h3 { font-size: 13px; font-weight: 700; color: var(--text-dark); margin-bottom: 4px; }
.feature-card p  { font-size: 11px; color: var(--text-muted); line-height: 1.4; }

/* ── Right side ── */
.right-side {
    flex: 1;
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.form-header { margin-bottom: 32px; }
.form-header h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 8px;
}

/* Alerts */
.alert-box {
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
}
.alert-danger  { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-box ul  { list-style: none; margin: 0; padding: 0; }

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

.input-wrapper { position: relative; }

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

.form-input {
    width: 100%;
    height: 56px;
    border: 2px solid var(--border);
    border-radius: 14px;
    padding: 16px 48px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-dark);
    background: #fff;
    font-family: "Be Vietnam Pro", sans-serif;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input::placeholder { color: var(--text-muted); font-weight: 400; }
.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(34,197,94,0.10);
}

.toggle-password {
    position: absolute;
    right: 16px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}
.toggle-password:hover { color: var(--text-dark); }

/* Remember / Forgot */
.form-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.remember-label {
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; color: var(--text-dark); cursor: pointer;
}
.remember-label input[type="checkbox"] {
    width: 18px; height: 18px;
    accent-color: var(--primary); cursor: pointer;
}
.forgot-link {
    font-size: 14px; font-weight: 600;
    color: var(--primary); text-decoration: none;
    transition: color 0.2s;
}
.forgot-link:hover { color: var(--primary-dark); }

/* Submit */
.submit-btn {
    width: 100%; height: 56px;
    background: var(--primary);
    color: #fff; border: none;
    border-radius: 14px;
    font-size: 16px; font-weight: 700;
    font-family: "Be Vietnam Pro", sans-serif;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(34,197,94,0.3);
}
.submit-btn:hover  { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(34,197,94,0.4); }
.submit-btn:active { transform: translateY(0); }

/* Divider */
.divider {
    text-align: center;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 14px;
    position: relative;
}
.divider::before, .divider::after {
    content: '';
    position: absolute;
    top: 50%; width: 40%; height: 1px;
    background: var(--border);
}
.divider::before { left: 0; }
.divider::after  { right: 0; }

/* Signup link */
.signup-link { text-align: center; font-size: 14px; color: var(--text-muted); }
.signup-link a { color: var(--primary); font-weight: 600; text-decoration: none; transition: color 0.2s; }
.signup-link a:hover { color: var(--primary-dark); }

/* ══════════════════════════════
   WELCOME TOAST
══════════════════════════════ */
.welcome-toast {
    position: fixed;
    top: 24px; right: 24px;
    transform: translateX(calc(100% + 24px));
    background: #fff;
    border-radius: 12px;
    padding: 16px 24px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
    display: flex; align-items: center; gap: 14px;
    z-index: 9999;
    transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
    min-width: 280px; max-width: 360px;
    border-left: 4px solid var(--primary);
}
.welcome-toast.show { transform: translateX(0); }
.welcome-toast .toast-icon  { font-size: 26px; color: var(--primary); flex-shrink: 0; }
.welcome-toast .toast-title { font-size: 15px; font-weight: 700; color: var(--text-dark); margin-bottom: 2px; }
.welcome-toast .toast-sub   { font-size: 13px; color: var(--text-muted); }

/* ── Mobile logo (ẩn trên desktop, hiện trên mobile) ── */
.mobile-logo {
    display: none;
    align-items: center;
    gap: 6px;
    margin-bottom: 24px;
}
.mobile-logo .logo-icon {
    width: 40px; height: 40px;
    background: var(--primary);
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 20px; font-weight: 800;
}
.mobile-logo .logo-text {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
}

/* ══════════════════════════════
   RESPONSIVE – Tablet (≤ 1024px)
══════════════════════════════ */
@media (max-width: 1024px) {
    .left-side, .right-side { padding: 50px 40px; }
    .welcome-text h1 { font-size: 28px; }
}

/* ══════════════════════════════
   RESPONSIVE – Mobile (≤ 768px)
   Ẩn left-side, hiện card đơn giản
══════════════════════════════ */
@media (max-width: 768px) {
    body {
        background: #f0f2f5;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 24px 16px;
        min-height: 100dvh;
        overflow-x: hidden;
        overflow-y: auto;
    }
    body::before,
    body::after { display: none; }
    .skyline    { display: none; }

    /* Card căn giữa */
    .login-container {
        display: block;
        width: 100%;
        max-width: 420px;
        min-height: unset;
        border-radius: 20px;
        box-shadow: 0 4px 24px rgba(0,0,0,0.09);
        margin: auto;
        overflow: hidden;
    }

    /* Ẩn left-side */
    .left-side { display: none; }

    /* Hiện logo mini */
    .mobile-logo { display: flex; }

    /* Form chiếm toàn bộ card */
    .right-side {
        padding: 32px 20px;
        justify-content: flex-start;
        border-radius: 20px;
        width: 100%;
    }

    .form-header        { margin-bottom: 20px; }
    .form-header h2     { font-size: 21px; }
    .form-group         { margin-bottom: 14px; }
    .form-input         { height: 50px; font-size: 14px; border-radius: 12px; }
    .submit-btn         { height: 50px; font-size: 15px; border-radius: 12px; }

    /* Remember + Forgot cùng 1 hàng */
    .form-meta {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 10px 8px;
        margin-bottom: 20px;
    }
    .remember-label { font-size: 13px; }
    .forgot-link    { font-size: 13px; }

    /* Toast xuống bottom */
    .welcome-toast {
        top: auto; bottom: 16px;
        right: 12px; left: 12px;
        max-width: unset; min-width: unset;
        transform: translateY(calc(100% + 24px));
        border-radius: 14px;
    }
    .welcome-toast.show { transform: translateY(0); }
}

/* ══════════════════════════════
   RESPONSIVE – Small mobile (≤ 400px)
══════════════════════════════ */
@media (max-width: 400px) {
    body { padding: 16px 12px; }

    .login-container { border-radius: 16px; }

    .right-side { padding: 28px 16px; }

    .form-header h2 { font-size: 19px; }
    .form-input     { height: 48px; }
    .submit-btn     { height: 48px; font-size: 14px; }
}
