/* ============================================================
   TPTVK - Login Page Styles
   로그인 페이지 / Trang đăng nhập
   ============================================================ */

/* ── Page Background ─────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1a2b4a 40%, #1e40af 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

/* Decorative background circles */
.login-page::before,
.login-page::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.login-page::before {
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(37,99,235,0.18) 0%, transparent 70%);
    top: -150px; right: -150px;
}
.login-page::after {
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    bottom: -100px; left: -80px;
}

/* ── Floating particles (decoration) ────────────────────── */
.login-particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    animation: float-up linear infinite;
    pointer-events: none;
}
@keyframes float-up {
    0%   { transform: translateY(0) rotate(0deg); opacity: 0.6; }
    100% { transform: translateY(-100vh) rotate(360deg); opacity: 0; }
}

/* ── Card ────────────────────────────────────────────────── */
.login-card {
    background: rgba(255, 255, 255, 0.97);
    border-radius: 24px;
    padding: 52px 44px 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.35), 0 4px 16px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
    animation: card-appear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255,255,255,0.3);
}
@keyframes card-appear {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Logo Area ───────────────────────────────────────────── */
.login-logo {
    text-align: center;
    margin-bottom: 28px;
}
.login-logo-img {
    width: 160px;
    height: 160px;
    object-fit: contain;
    margin-bottom: 8px;
    filter: drop-shadow(0 4px 16px rgba(30,64,175,0.18));
    animation: logo-pop 0.6s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes logo-pop {
    from { transform: scale(0.7); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}
.login-logo-icon {
    display: none; /* 이미지 로고로 대체 */
}
.login-logo-text {
    display: none; /* 이미지 로고로 대체 */
}
.login-logo-sub {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ── Heading ─────────────────────────────────────────────── */
.login-heading {
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.login-heading-vn {
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 28px;
}

/* ── Error Alert ─────────────────────────────────────────── */
.login-error {
    display: none;
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.25);
    color: var(--status-red);
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 16px;
    text-align: center;
    animation: shake 0.35s ease;
}
.login-error.visible { display: flex; align-items: center; justify-content: center; gap: 6px; }
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25%       { transform: translateX(-6px); }
    75%       { transform: translateX(6px); }
}

/* ── Form ────────────────────────────────────────────────── */
.login-form .form-group { margin-bottom: 16px; }

.login-form .form-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 7px;
}

.login-form .input-wrap {
    position: relative;
}
.login-form .input-icon {
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 15px;
    pointer-events: none;
}
.login-form .form-input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    outline: none;
    background: var(--light-gray);
    transition: var(--transition-fast);
    color: var(--text-primary);
}
.login-form .form-input:focus {
    border-color: var(--blue);
    background: white;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.login-form .form-input::placeholder { color: var(--text-muted); font-size: 13px; }

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

/* ── Submit Button ───────────────────────────────────────── */
.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #1d4ed8, #2563EB);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
    transition: var(--transition-fast);
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}
.login-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0);
    transition: background 0.2s;
}
.login-btn:hover::after { background: rgba(255,255,255,0.1); }
.login-btn:active { transform: scale(0.98); }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Loading spinner inside button */
.login-btn .spinner {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Divider ─────────────────────────────────────────────── */
.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 18px;
    color: var(--text-muted);
    font-size: 12px;
}
.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── Test Accounts ───────────────────────────────────────── */
.test-accounts-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.7px;
    margin-bottom: 10px;
    text-align: center;
}
.test-accounts-grid {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.test-account-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    background: var(--light-gray);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: left;
    color: var(--text-primary);
}
.test-account-btn:hover {
    background: white;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}
.test-account-btn .role-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.test-account-btn .acc-id   { font-weight: 700; color: var(--blue); font-size: 13px; }
.test-account-btn .acc-role { color: var(--text-secondary); font-size: 11px; margin-left: auto; }
.test-account-btn .acc-flag { font-size: 16px; }

/* ── Footer Note ─────────────────────────────────────────── */
.login-footer-note {
    margin-top: 20px;
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.6;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}
.login-footer-note .lang-flags { font-size: 16px; letter-spacing: 4px; display: block; margin-bottom: 4px; }

/* ── Register Link ───────────────────────────────────────── */
.login-register-link {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 14px 0 4px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}
.login-register-link a {
    color: var(--blue);
    font-weight: 700;
    text-decoration: none;
    margin-left: 6px;
    transition: color 0.2s;
}
.login-register-link a:hover { color: var(--blue-dark, #1d4ed8); text-decoration: underline; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .login-page { padding: 16px; align-items: flex-start; padding-top: 40px; }
    .login-card  { padding: 36px 24px 28px; max-width: 100%; }
    .login-input { font-size: 16px; } /* iOS 자동 줌 방지 */
    .login-btn   { font-size: 15px; padding: 14px; }
    .demo-accounts { gap: 8px; }
    .demo-account  { padding: 10px 12px; }
}

@media (max-width: 480px) {
    .login-page  { padding: 12px; padding-top: 28px; }
    .login-card  { padding: 28px 18px 24px; border-radius: var(--radius-lg); }
    .login-logo-text { font-size: 26px; }
    .login-subtitle { font-size: 12px; }
    .demo-accounts  { flex-direction: column; }
    .demo-account   { width: 100%; }
}
