/* ==========================================================================
   FPT TELECOM — AUTHENTICATION STYLESHEET (GLASSMORPHISM)
   Dùng chung cho các trang: Login, Register, Forgot Password, Reset Password
   --------------------------------------------------------------------------
   MỤC LỤC / TABLE OF CONTENTS:
   1. VARIABLES & CSS CUSTOM PROPERTIES
   2. BASE RESET & PAGE LAYOUT
   3. ANIMATED GRADIENT BACKGROUND (BLOBS)
   4. TOP BAR NAVIGATION & LOGO
   5. AUTH CARD CONTAINER & FORM WRAPPER
   6. TYPOGRAPHY & ANIMATION UTILITIES (BLUR-FADE)
   7. SOCIAL AUTH BUTTON (GOOGLE OAUTH)
   8. FORM DIVIDER (HOẶC / OR)
   9. GLASS INPUT FIELDS & ICONS
   10. BUTTONS & ACTIONS (SUBMIT BUTTONS, TOGGLE PASSWORD)
   11. FORM CONTROLS (PASSWORD STRENGTH METER, CHECKBOX)
   12. ALERTS & NOTIFICATION BANNERS
   13. INTERACTIVE MODAL (LOADING, SUCCESS, ERROR)
   14. RESPONSIVE DESIGN (TABLET & MOBILE)
   ========================================================================== */

/* ==========================================================================
   1. VARIABLES & CSS CUSTOM PROPERTIES
   ========================================================================== */
@property --angle-1 {
    syntax: "<angle>";
    inherits: false;
    initial-value: -75deg;
}

@property --angle-2 {
    syntax: "<angle>";
    inherits: false;
    initial-value: -45deg;
}

/* ==========================================================================
   2. BASE RESET & PAGE LAYOUT
   ========================================================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.login-body {
    font-family: 'Be Vietnam Pro', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #0a0f1e;
    overflow-x: hidden;
    position: relative;
    color: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   3. HARDWARE-ACCELERATED AMBIENT BACKGROUND (0% CPU LOAD)
   ========================================================================== */
.login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, #0d1527 0%, #0a0f1e 100%);
    pointer-events: none;
}

.login-blob {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.blob-1 {
    width: 600px;
    height: 600px;
    top: -120px;
    left: -120px;
    background: radial-gradient(circle, rgba(243, 112, 33, 0.28) 0%, rgba(243, 112, 33, 0.12) 40%, rgba(243, 112, 33, 0) 70%);
}

.blob-2 {
    width: 650px;
    height: 650px;
    bottom: -150px;
    right: -150px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.25) 0%, rgba(168, 85, 247, 0.10) 40%, rgba(168, 85, 247, 0) 70%);
}

.blob-3 {
    width: 450px;
    height: 450px;
    top: 50%;
    right: 10%;
    transform: translateY(-50%);
    background: radial-gradient(circle, rgba(244, 114, 182, 0.15) 0%, rgba(244, 114, 182, 0.05) 45%, rgba(244, 114, 182, 0) 70%);
}

/* Lớp phủ radial vignette giúp chữ luôn dễ đọc */
.login-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        rgba(10, 15, 30, 0.25) 60%,
        rgba(10, 15, 30, 0.70) 100%
    );
    pointer-events: none;
}

/* ==========================================================================
   4. TOP BAR NAVIGATION & LOGO
   ========================================================================== */
/* Nút quay lại trang chủ ở góc trên bên trái */
.back-home-wrap {
    position: fixed;
    top: 20px;
    left: 24px;
    z-index: 30;
}

.btn-back-glass {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.25s ease;
}

.btn-back-glass:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    transform: translateX(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-back-glass svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2.2;
    fill: none;
}

/* Logo FPT Telecom căn giữa phía trên */
.login-logo {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.login-logo:hover {
    transform: translateX(-50%) scale(1.05);
    opacity: 0.95;
}

.login-logo-img {
    height: 48px;
    width: auto;
    object-fit: contain;
    display: block;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    transition: box-shadow 0.25s ease;
}

.login-logo:hover .login-logo-img {
    box-shadow: 0 6px 20px rgba(243, 112, 33, 0.4);
}


/* ==========================================================================
   5. AUTH CARD CONTAINER & FORM WRAPPER
   ========================================================================== */
.login-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 85px 20px 45px;
    position: relative;
    z-index: 10;
}

.login-wrap {
    width: 100%;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Khung rộng hơn cho trang Đăng ký để thoáng các trường */
.login-wrap.register-wrap {
    max-width: 420px;
}

.login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* ==========================================================================
   6. TYPOGRAPHY & ANIMATION UTILITIES (BLUR-FADE)
   ========================================================================== */
.login-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 300;
    font-size: 38px;
    letter-spacing: -0.8px;
    color: #ffffff;
    line-height: 1.15;
    margin: 0;
    text-align: center;
}

@media (min-width: 640px) {
    .login-title { font-size: 44px; }
}

.login-sub {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.65);
    max-width: 360px;
    text-align: center;
    line-height: 1.4;
}

.login-sub a {
    color: #ffb26b;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s ease;
}

.login-sub a:hover {
    text-decoration: underline;
    color: #ffd29d;
}

/* Hiệu ứng Fade In mượt mà 60fps khi tải giao diện (không dùng filter blur để loại bỏ giật lag) */
.blur-fade {
    opacity: 0;
    transform: translateY(8px);
    animation: authFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.blur-fade[data-delay="1"] { animation-delay: 0.02s; }
.blur-fade[data-delay="2"] { animation-delay: 0.05s; }
.blur-fade[data-delay="3"] { animation-delay: 0.08s; }
.blur-fade[data-delay="4"] { animation-delay: 0.11s; }
.blur-fade[data-delay="5"] { animation-delay: 0.14s; }
.blur-fade[data-delay="6"] { animation-delay: 0.17s; }
.blur-fade[data-delay="7"] { animation-delay: 0.20s; }
.blur-fade[data-delay="8"] { animation-delay: 0.23s; }
.blur-fade[data-delay="9"] { animation-delay: 0.26s; }

/* ==========================================================================
   7. SOCIAL AUTH BUTTON (GOOGLE OAUTH)
   ========================================================================== */
.login-socials {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
}

.glass-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px 22px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.2px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    transition: all 0.2s ease;
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.glass-btn:active {
    transform: translateY(0);
}

.glass-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ==========================================================================
   8. FORM DIVIDER (HOẶC / OR)
   ========================================================================== */
.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 300px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    padding: 4px 0;
}

.register-wrap .login-divider {
    max-width: 100%;
}

.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   9. GLASS INPUT FIELDS & ICONS
   ========================================================================== */
.glass-input-wrap {
    position: relative;
    width: 100%;
    max-width: 300px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.register-wrap .glass-input-wrap {
    max-width: 100%;
}

.glass-input-wrap:focus-within {
    background: rgba(255, 255, 255, 0.08);
    border-color: #f37021;
    box-shadow:
        0 0 0 3px rgba(243, 112, 33, 0.22),
        0 4px 16px rgba(0, 0, 0, 0.35);
}

.glass-input-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.glass-input-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.glass-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 500;
    padding: 8px 0;
    position: relative;
    z-index: 2;
    min-width: 0;
}

.glass-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.glass-input:-webkit-autofill,
.glass-input:-webkit-autofill:hover,
.glass-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #ffffff !important;
    -webkit-box-shadow: 0 0 0 1000px transparent inset !important;
    transition: background-color 5000s ease-in-out 0s;
    caret-color: #ffffff;
}

/* ==========================================================================
   10. BUTTONS & ACTIONS (SUBMIT BUTTONS, TOGGLE PASSWORD)
   ========================================================================== */
/* Nút submit tròn nhỏ có mũi tên ở form đăng nhập */
.glass-submit-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #f37021, #ff8c42);
    border: none;
    cursor: pointer;
    color: #ffffff;
    flex-shrink: 0;
    transition: all 0.25s;
    position: relative;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(243, 112, 33, 0.4);
}

.glass-submit-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(243, 112, 33, 0.6);
}

.glass-submit-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Nút ẩn/hiện mật khẩu */
.glass-toggle-pass {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.65);
    border-radius: 50%;
    transition: all 0.2s;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.glass-toggle-pass:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.glass-toggle-pass svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Nút Submit chính dạng viên thuốc toàn chiều rộng */
.glass-btn-primary {
    width: 100%;
    padding: 13px 24px;
    border-radius: 999px;
    background: linear-gradient(135deg, #f37021, #ff8c42);
    border: none;
    color: #ffffff;
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(243, 112, 33, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.25s ease;
    font-family: inherit;
    margin-top: 6px;
}

.glass-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(243, 112, 33, 0.65);
    filter: brightness(1.08);
}

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

.glass-btn-primary svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2.2;
    fill: none;
}

/* Link quên mật khẩu */
.login-forgot-link {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    transition: color 0.2s ease;
}

.login-forgot-link:hover {
    color: #ffb26b;
    text-decoration: underline;
}

/* ==========================================================================
   11. FORM CONTROLS (PASSWORD STRENGTH METER, CHECKBOX)
   ========================================================================== */
/* Thanh đo độ mạnh mật khẩu */
.pwd-meter {
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pwd-meter-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
}

.pwd-meter-status {
    font-weight: 700;
}

.pwd-meter-status.weak { color: #f87171; }
.pwd-meter-status.medium { color: #fbbf24; }
.pwd-meter-status.strong { color: #34d399; }

.pwd-meter-bars {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    height: 4px;
}

.pwd-bar {
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.12);
    transition: background 0.3s ease;
}

.pwd-bar.active-weak { background: #ef4444; }
.pwd-bar.active-medium { background: #f59e0b; }
.pwd-bar.active-strong { background: #10b981; }

.pwd-rules {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 2px;
}

.pwd-rule.ok {
    color: #34d399;
}

/* Checkbox điều khoản kính mờ */
.glass-cbx-wrap {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.45;
    cursor: pointer;
    text-align: left;
    margin: 4px 0;
}

.glass-cbx-wrap input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    accent-color: #f37021;
    cursor: pointer;
    flex-shrink: 0;
}

.glass-cbx-wrap a {
    color: #ffb26b;
    text-decoration: none;
    font-weight: 600;
}

.glass-cbx-wrap a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   12. ALERTS & NOTIFICATION BANNERS
   ========================================================================== */
.glass-alert {
    width: 100%;
    max-width: 100%;
    padding: 12px 16px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    line-height: 1.45;
    text-align: left;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: blurFadeIn 0.3s ease;
}

.glass-alert-error {
    background: rgba(239, 68, 68, 0.18);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.glass-alert-success {
    background: rgba(34, 197, 94, 0.18);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #86efac;
}

.glass-alert svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ==========================================================================
   13. INTERACTIVE MODAL (LOADING, SUCCESS, ERROR)
   ========================================================================== */
.login-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.login-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.login-modal {
    background: rgba(20, 25, 40, 0.92);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 36px 32px;
    width: 100%;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    position: relative;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
    from { transform: scale(0.9); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.login-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.login-modal-close.hidden { display: none; }

.login-modal-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.login-modal-close svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-modal-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f37021;
}

.login-modal-icon svg {
    width: 48px;
    height: 48px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-modal-icon.success svg {
    stroke: #22c55e;
}

.login-modal-text {
    font-size: 16.5px;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
    font-family: inherit;
    line-height: 1.4;
}

.login-modal-text.error {
    color: #fca5a5;
}

.spinner {
    animation: spin 1s linear infinite;
}

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

/* ==========================================================================
   14. RESPONSIVE DESIGN (TABLET & MOBILE)
   ========================================================================== */
@media (max-width: 640px) {
    .back-home-wrap {
        top: max(12px, env(safe-area-inset-top, 12px));
        left: 14px;
    }
    .btn-back-glass {
        padding: 8px 13px;
        font-size: 12.5px;
        min-height: 38px;
        box-sizing: border-box;
    }
    .login-logo {
        top: max(12px, env(safe-area-inset-top, 12px));
        right: 14px;
        left: auto;
        transform: none;
    }
    .login-logo:hover {
        transform: scale(1.03);
    }
    .login-logo-img {
        height: 38px;
    }
    .login-main {
        padding: 76px 16px 36px;
        align-items: flex-start;
    }
    .login-wrap,
    .login-wrap.register-wrap {
        max-width: 100%;
    }
    .glass-input-wrap {
        max-width: 100%;
    }
    .glass-input {
        font-size: 16px;
        min-height: 46px;
        box-sizing: border-box;
    }
    .glass-btn-primary,
    .glass-btn {
        min-height: 46px;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    .login-title { font-size: clamp(28px, 8vw, 32px); }
    .login-sub { font-size: 13px; }
    .login-socials { flex-direction: column; align-items: stretch; width: 100%; }
    .glass-btn { justify-content: center; width: 100%; }
    .login-logo h1 { font-size: 14px; }
    .login-modal { padding: 28px 22px; }
}

/* ==========================================================================
   15. PERFORMANCE OPTIMIZATION (60FPS HARDWARE ACCELERATED)
   ========================================================================== */
.login-body {
    contain: paint;
    overscroll-behavior-y: contain;
}

.login-bg,
.login-blob,
.glass-input-wrap,
.glass-btn,
.glass-btn-primary {
    transform: translateZ(0);
    backface-visibility: hidden;
}

@media (max-width: 768px) {
    .login-modal-overlay {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(10, 15, 30, 0.90) !important;
    }
}