/* ─────────────────────────────────────────────────────────────
   Hong Phat R&D — Custom Login Page
   Design: Corporate Precision / Dark Edition
   ───────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@600;700&display=swap');

/* ── Biến màu ─────────────────────────────────────────── */
:root {
    --bg-deep:      #0d1117;
    --bg-card:      #ffffff;
    --accent-blue:  #2563eb;
    --accent-glow:  rgba(37,99,235,0.18);
    --accent-line:  #3b82f6;
    --text-primary: #0f172a;
    --text-muted:   #64748b;
    --border:       #e2e8f0;
    --input-bg:     #f8fafc;
    --input-focus:  #eff6ff;
    --error-bg:     #fef2f2;
    --error-border: #fca5a5;
    --success-bg:   #f0fdf4;
    --success-border:#86efac;
    --grid-color:   rgba(255,255,255,0.035);
}

/* ── Reset & Body ─────────────────────────────────────── */
html, body.login {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: var(--bg-deep);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* Lưới nền tinh tế */
body.login::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
    z-index: 0;
}

/* Vệt sáng góc trên trái */
body.login::after {
    content: '';
    position: fixed;
    top: -200px;
    left: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(37,99,235,0.12) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}

/* ── Wrapper ──────────────────────────────────────────── */
#login {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 48px 16px 32px;
    box-sizing: border-box;
}

/* ── Logo / Header ────────────────────────────────────── */
#login h1 {
    margin: 0 0 32px;
    text-align: center;
}

#login h1 a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
    outline: none !important;
    box-shadow: none !important;
    width: auto !important;
    height: auto !important;
    background: none !important;
}

/* Icon vòng tròn */
#login h1 a::before {
    content: 'HP';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    border-radius: 16px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.02em;
    box-shadow: 0 0 0 1px rgba(37,99,235,0.3), 0 8px 24px rgba(37,99,235,0.3);
}

/* Tên hệ thống */
#login h1 a::after {
    content: 'Hong Phat R&D';
    font-family: 'Space Grotesk', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
}

/* Ẩn text gốc của WordPress */
#login h1 a span {
    display: none !important;
}

/* Sub-label dưới logo */
#login h1::after {
    content: 'Hong Phat R&D — Hệ thống nội bộ';
    display: block;
    font-size: 12px;
    color: rgba(255,255,255,0.38);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 400;
    letter-spacing: 0.02em;
    margin-top: 8px;
}

/* ── Card Form ────────────────────────────────────────── */
#loginform,
#lostpasswordform,
#registerform {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 32px 32px 28px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.04),
        0 24px 48px rgba(0,0,0,0.45),
        0 8px 16px rgba(0,0,0,0.25);
    margin: 0 0 16px;
}

/* ── Labels ───────────────────────────────────────────── */
#loginform label,
#lostpasswordform label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

/* ── Inputs ───────────────────────────────────────────── */
#loginform input[type="text"],
#loginform input[type="password"],
#loginform input[type="email"],
#lostpasswordform input[type="text"],
#lostpasswordform input[type="email"] {
    width: 100%;
    padding: 11px 14px;
    background: var(--input-bg);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.18s ease;
    box-sizing: border-box;
    box-shadow: none;
    outline: none;
    -webkit-appearance: none;
}

#loginform input[type="text"]:focus,
#loginform input[type="password"]:focus,
#loginform input[type="email"]:focus,
#lostpasswordform input[type="text"]:focus,
#lostpasswordform input[type="email"]:focus {
    border-color: var(--accent-line);
    background: var(--input-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Placeholder */
#loginform input::placeholder,
#lostpasswordform input::placeholder {
    color: #c1c9d4;
}

/* ── Spacer giữa các trường ───────────────────────────── */
.login-username,
.login-password {
    margin-bottom: 18px;
}

/* ── Submit Button ────────────────────────────────────── */
#loginform .submit,
#lostpasswordform .submit {
    margin-top: 6px;
}

#wp-submit,
#lostpasswordform .button {
    display: block;
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    color: #fff !important;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: 0 4px 14px rgba(37,99,235,0.35);
    box-sizing: border-box;
    text-align: center;
    height: auto;
    line-height: 1.5;
}

#wp-submit:hover,
#lostpasswordform .button:hover {
    background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
    box-shadow: 0 6px 20px rgba(37,99,235,0.45);
    transform: translateY(-1px);
}

#wp-submit:active,
#lostpasswordform .button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}

/* ── Remember me ──────────────────────────────────────── */
.login-remember {
    margin: 16px 0 0;
}

.login-remember label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 400;
    color: var(--text-muted);
    text-transform: none !important;
    letter-spacing: 0 !important;
    cursor: pointer;
}

.login-remember input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--accent-blue);
    cursor: pointer;
    flex-shrink: 0;
}

/* ── Nav links (Quên mật khẩu…) ──────────────────────── */
#nav, #backtoblog {
    text-align: center;
    margin: 0;
    padding: 10px 0;
}

#nav a, #backtoblog a {
    font-size: 13px;
    color: rgba(255,255,255,0.45) !important;
    text-decoration: none !important;
    transition: color 0.15s;
}

#nav a:hover, #backtoblog a:hover {
    color: rgba(255,255,255,0.75) !important;
}

/* ── Messages / Errors ────────────────────────────────── */
.message,
#login_error {
    border-radius: 8px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    padding: 12px 16px;
    margin-bottom: 16px;
    border-left: 3px solid;
}

.message {
    background: var(--success-bg);
    border-color: #22c55e;
    color: #166534;
    box-shadow: none;
}

#login_error {
    background: var(--error-bg);
    border-color: #ef4444;
    color: #991b1b;
    box-shadow: none;
}

#login_error a {
    color: var(--accent-blue) !important;
}

/* ── Footer ───────────────────────────────────────────── */
#login_footer_links {
    text-align: center;
}

/* Thanh phân cách bottom */
#login::after {
    content: '© ' attr(data-year) ' Hong Phat R&D — Hệ thống quản trị nội bộ';
    display: block;
    text-align: center;
    font-size: 11px;
    color: rgba(255,255,255,0.2);
    margin-top: 28px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    letter-spacing: 0.02em;
}

/* ── Shake animation khi login sai ───────────────────── */
@keyframes rdtm-shake {
    0%, 100% { transform: translateX(0); }
    15%       { transform: translateX(-6px); }
    30%       { transform: translateX(6px); }
    45%       { transform: translateX(-4px); }
    60%       { transform: translateX(4px); }
    75%       { transform: translateX(-2px); }
    90%       { transform: translateX(2px); }
}

body.login-error #loginform {
    animation: rdtm-shake 0.45s ease;
}

/* ── Fade-in card ─────────────────────────────────────── */
@keyframes rdtm-fadein {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

#loginform,
#login h1,
#nav {
    animation: rdtm-fadein 0.4s ease both;
}
#login h1       { animation-delay: 0s; }
#loginform      { animation-delay: 0.06s; }
#nav            { animation-delay: 0.12s; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 480px) {
    #login {
        padding: 32px 12px 24px;
    }
    #loginform,
    #lostpasswordform,
    #registerform {
        padding: 24px 20px 20px;
    }
}
