
    :root {
        /* Màu sắc hệ thống */
        --coral: oklch(68% .17 22);
        --coral-soft: oklch(78% .12 25);
        --coral-hex: #e8705f;
        --coral-soft-hex: #f0a090;
        --teal: #38d9c0;
        --teal-dark: #22b8a0;

        --navy-900: #0d2d5e;
        --navy-700: #1a4a7a;
        --navy-500: #4a6fa5;
        --navy-300: #4a5f78;
        --navy-100: #eef2f7;

        --surface-page: #f0f4f8;
        --surface-card: #ffffff;
        --surface-muted: #f7f9fc;

        --border: rgba(26, 74, 122, 0.08);
        --border-hover: rgba(26, 74, 122, 0.18);

        --shadow-sm: 0 2px 8px rgba(13, 45, 94, 0.05);
        --shadow-md: 0 8px 24px rgba(13, 45, 94, 0.10);
        --shadow-lg: 0 16px 48px rgba(13, 45, 94, 0.13);

        /* Cỡ chữ */
        --text-xs: 12px;
        --text-sm: 14px;
        --text-base: 15px;
        --text-md: 18px;
        --text-lg: 22px;

        /* Khoảng cách */
        --space-1: 4px;
        --space-2: 8px;
        --space-3: 12px;
        --space-4: 16px;
        --space-5: 24px;
        --space-6: 32px;
        --space-7: 48px;
        --space-8: 64px;
        --space-9: 80px;

        /* Bo góc và hiệu ứng */
        --radius-sm: 8px;
        --radius-md: 12px;
        --radius-lg: 16px;
        --radius-xl: 24px;
        --radius-full: 9999px;
        --ease-out: cubic-bezier(.22, .68, 0, 1.2);
        --duration: 200ms;

        /* Màu bổ sung chuẩn thương hiệu Mamaliho */
        --brand-dark-red: #8b1424;
        --brand-teal-dark: #1e4d46;
        --brand-icon-green: #10a37f;
    }

    /* Reset CSS cơ bản */
    *,
    *::before,
    *::after {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
    }

    body {
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
        background-color: var(--surface-page);
        color: var(--navy-300);
        -webkit-font-smoothing: antialiased;
    }

    /* --- HỆ THỐNG MODAL --- */
    .modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(13, 45, 94, 0.65);
        backdrop-filter: blur(4px);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: var(--space-3);
        z-index: 9999;
        display: none;
        /* Ẩn mặc định, điều khiển bằng JS */
    }

    .profile-modal {
        background-color: var(--surface-card);
        width: calc(100% - 2 * var(--space-4));
        max-width: 490px;
        max-height: 92vh;
        border-radius: var(--radius-xl);
        box-shadow: var(--shadow-lg);
        padding: var(--space-5) var(--space-5) var(--space-4) var(--space-5);
        display: flex;
        flex-direction: column;
        animation: modalFadeIn var(--duration) var(--ease-out);
    }

    @keyframes modalFadeIn {
        from {
            transform: translateY(20px);
            opacity: 0;
        }

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

    .modal-header {
        text-align: center;
        margin-bottom: var(--space-4);
    }

    .modal-header .avatar-icon {
        width: 46px;
        height: 46px;
        background-color: var(--brand-icon-green);
        color: var(--surface-card);
        border-radius: var(--radius-full);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-bottom: var(--space-2);
    }

    .modal-header .login-icon {
        background-color: var(--navy-700);
    }

    .modal-header .avatar-icon svg {
        width: 24px;
        height: 24px;
    }

    .modal-header h2 {
        color: var(--navy-700);
        font-size: var(--text-lg);
        font-weight: 700;
        margin-bottom: var(--space-1);
    }

    .modal-header p {
        color: var(--navy-300);
        font-size: var(--text-sm);
        line-height: 1.4;
    }

    .modal-form {
        display: flex;
        flex-direction: column;
        gap: var(--space-3);
        overflow-y: auto;
        padding-right: var(--space-1);
    }

    .modal-form::-webkit-scrollbar {
        width: 4px;
    }

    .modal-form::-webkit-scrollbar-thumb {
        background-color: rgba(26, 74, 122, 0.15);
        border-radius: var(--radius-full);
    }

    .form-group {
        display: flex;
        flex-direction: column;
        gap: var(--space-1);
    }

    .form-group .label-wrapper {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .form-group label {
        font-size: var(--text-sm);
        font-weight: 600;
        color: var(--navy-700);
    }

    .form-group label .required {
        color: var(--coral-hex);
        margin-left: var(--space-1);
    }

    .form-group .forgot-password {
        font-size: var(--text-xs);
        color: var(--navy-500);
        text-decoration: none;
    }

    .form-group .forgot-password:hover {
        text-decoration: underline;
        color: var(--coral-hex);
    }

    .form-group input,
    .form-group select {
        width: 100%;
        height: 40px;
        padding: 0 var(--space-4);
        font-size: var(--text-base);
        color: var(--navy-900);
        background-color: var(--surface-card);
        border: 1px solid rgba(26, 74, 122, 0.15);
        border-radius: var(--radius-md);
        outline: none;
        transition: border-color var(--duration) var(--ease-out), box-shadow var(--duration) var(--ease-out);
    }

    .form-group input::placeholder {
        color: #b0c0d2;
    }

    .form-group input:focus,
    .form-group select:focus {
        border-color: var(--navy-500);
        box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.12);
    }

    /* --- CẤU TRÚC CONTAINER INPUT CHỨA ICON --- */
    .input-with-icon {
        position: relative;
        display: flex;
        align-items: center;
    }

    /* Icon thông thường (như lịch ngày sinh) - Giữ nguyên không cho tương tác chuột */
    .input-with-icon .icon-suffix {
        position: absolute;
        right: var(--space-4);
        color: #b0c0d2;
        pointer-events: none;
        display: flex;
        align-items: center;
    }

    /* ĐẶC TRỊ RIÊNG CHO NÚT CON MẮT: Khôi phục lại click và hiển thị bàn tay chuẩn xác */
    .input-with-icon .password-toggle {
        position: absolute;
        right: var(--space-4);
        top: 50%;
        transform: translateY(-50%);
        z-index: 10;
        cursor: pointer !important;
        /* Ép hiện bàn tay */
        pointer-events: auto !important;
        /* BẬT LẠI khả năng nhận click chuột */
        padding: var(--space-2);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Ngăn icon Font Awesome lõi bên trong nuốt mất event click của thẻ cha span */
    .input-with-icon .password-toggle i {
        pointer-events: none !important;
        font-size: 16px;
        color: #b0c0d2;
    }

    /* Custom dropdown Select */
    .select-wrapper {
        position: relative;
    }

    .select-wrapper::after {
        content: '';
        position: absolute;
        right: var(--space-4);
        top: 50%;
        transform: translateY(-50%);
        border: 5px solid transparent;
        border-top-color: #b0c0d2;
        pointer-events: none;
    }

    .form-group select {
        appearance: none;
        -webkit-appearance: none;
        padding-right: var(--space-6);
    }

    .form-group select:invalid {
        color: #b0c0d2;
    }

    /* Hệ thống nút bấm */
    .form-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-3);
        margin-top: var(--space-3);
    }

    .btn {
        height: 40px;
        border-radius: var(--radius-full);
        font-size: var(--text-base);
        font-weight: 600;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: all var(--duration) var(--ease-out);
    }

    .btn-cancel {
        background-color: transparent;
        border: 1px solid rgba(26, 74, 122, 0.25);
        color: var(--navy-500);
    }

    .btn-cancel:hover {
        background-color: var(--navy-100);
        color: var(--navy-700);
    }

    .btn-submit {
        background-color: var(--coral);
        border: none;
        color: var(--surface-card);
    }

    .btn-submit:hover {
        background-color: #720e1b;
        transform: translateY(-1px);
        box-shadow: var(--shadow-sm);
    }

    .btn-submit-teal {
        background-color: var(--coral);
        border: none;
        color: var(--surface-card);
    }

    .btn-submit-teal:hover {
        background-color: #13332e;
        transform: translateY(-1px);
        box-shadow: var(--shadow-sm);
    }

    .modal-footer {
        text-align: center;
        margin-top: var(--space-4);
        font-size: var(--text-sm);
        color: var(--navy-300);
    }

    .modal-footer a {
        color: var(--coral-hex);
        text-decoration: none;
        font-weight: 600;
        margin-left: var(--space-1);
    }

    .modal-footer a:hover {
        text-decoration: underline;
    }

    /* Màu sắc icon điều khoản */
    .modal-header .terms-icon {
        background-color: var(--brand-icon-green);
    }

    /* Cấu trúc các dòng nội dung điều khoản */
    .terms-content-wrapper {
        overflow-y: auto;
        max-height: 50vh;
        padding-right: var(--space-2);
    }

    .terms-row {
        display: flex;
        gap: var(--space-3);
        margin-bottom: var(--space-4);
        align-items: flex-start;
    }

    .terms-icon-circle {
        width: 36px;
        height: 36px;
        background-color: #f0f4f8;
        color: var(--navy-500);
        border-radius: var(--radius-full);
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .terms-icon-circle i {
        font-size: 16px;
    }

    .terms-row p {
        font-size: var(--text-sm);
        color: var(--navy-300);
        line-height: 1.5;
        text-align: justify;
    }

    .terms-divider {
        border: none;
        border-top: 1px solid rgba(26, 74, 122, 0.08);
        margin: var(--space-3) 0;
    }

    /* TÙY BIẾN CHECKBOX CHUẨN ĐẸP */
    .terms-checkbox-group {
        margin: var(--space-2) 0;
    }

    .custom-checkbox-container {
        display: flex;
        position: relative;
        cursor: pointer;
        font-size: var(--text-sm);
        user-select: none;
        align-items: flex-start;
        gap: var(--space-3);
    }

    .custom-checkbox-container input {
        position: absolute;
        opacity: 0;
        cursor: pointer;
        height: 0;
        width: 0;
    }

    .checkmark {
        height: 20px;
        width: 20px;
        background-color: var(--surface-card);
        border: 2px solid #b0c0d2;
        border-radius: var(--radius-sm);
        flex-shrink: 0;
        position: relative;
        transition: all var(--duration) var(--ease-out);
    }

    .custom-checkbox-container:hover input~.checkmark {
        border-color: var(--navy-500);
    }

    .custom-checkbox-container input:checked~.checkmark {
        background-color: var(--brand-icon-green);
        border-color: var(--brand-icon-green);
    }

    .checkmark:after {
        content: "";
        position: absolute;
        display: none;
    }

    .custom-checkbox-container input:checked~.checkmark:after {
        display: block;
    }

    .custom-checkbox-container .checkmark:after {
        left: 6px;
        top: 2px;
        width: 5px;
        height: 10px;
        border: solid white;
        border-width: 0 2px 2px 0;
        transform: rotate(45deg);
    }

    .checkbox-text {
        color: var(--navy-700);
        font-weight: 600;
        line-height: 1.4;
    }

    /* Link điều khoản phụ */
    .view-full-terms {
        margin-top: var(--space-2);
        margin-left: var(--space-7);
    }

    .view-full-terms a {
        font-size: var(--text-sm);
        color: var(--navy-500);
        text-decoration: none;
        font-weight: 500;
    }

    .view-full-terms a:hover {
        color: var(--coral-hex);
        text-decoration: underline;
    }

    /* --- ĐỊNH DẠNG RIÊNG CHO MODAL GÓI CHUYÊN SÂU --- */
    .premium-modal-card {
        position: relative;
        max-width: 440px !important;
        /* Độ rộng thu gọn hơn một chút theo mẫu */
        padding: var(--space-6) var(--space-5) var(--space-5) var(--space-5) !important;
    }

    /* Nút X đóng góc phải */
    .btn-close-x {
        position: absolute;
        top: var(--space-3);
        right: var(--space-4);
        background: none;
        border: none;
        font-size: 28px;
        color: var(--navy-300);
        cursor: pointer;
        line-height: 1;
        transition: color var(--duration) var(--ease-out);
    }

    .btn-close-x:hover {
        color: var(--coral-hex);
    }

    /* Phần Header Gói chuyên sâu */
    .premium-header {
        margin-bottom: var(--space-3);
    }

    .premium-header h2 {
        color: var(--brand-dark-red);
        /* Tông màu đỏ thương hiệu */
        font-size: 20px;
        font-weight: 700;
        margin-bottom: var(--space-1);
        letter-spacing: 0.5px;
    }

    .premium-header p {
        color: var(--navy-300);
        font-size: var(--text-sm);
    }

    /* Hiển thị giá tiền */
    .premium-price {
        font-size: 22px;
        font-weight: 700;
        color: var(--navy-900);
        margin-bottom: var(--space-4);
    }

    /* Wrapper và Nút Đăng ký màu xanh lục */
    .premium-action-wrapper {
        margin-bottom: var(--space-5);
    }

    .btn-submit-premium {
        width: 100%;
        height: 42px;
        background-color: var(--brand-icon-green);
        /* Xanh lục chuẩn Mamaliho */
        border: none;
        color: var(--surface-card);
        border-radius: var(--radius-full);
        font-size: var(--text-base);
        font-weight: 600;
        cursor: pointer;
        transition: background-color var(--duration) var(--ease-out), transform var(--duration) var(--ease-out);
    }

    .btn-submit-premium:hover {
        background-color: #0d8a6b;
        transform: translateY(-1px);
    }

    /* Danh sách gạch đầu dòng tính năng */
    .premium-features-list {
        list-style-type: disc;
        padding-left: var(--space-4);
        display: flex;
        flex-direction: column;
        gap: var(--space-3);
        text-align: left;
    }

    .premium-features-list li {
        font-size: var(--text-xs);
        color: var(--navy-300);
        line-height: 1.5;
    }

    /* --- CSS POPUP THÀNH CÔNG --- */
    .success-modal-card {
        max-width: 400px !important;
        padding: var(--space-6) var(--space-5) !important;
        text-align: center;
    }

    .success-icon {
        background-color: var(--brand-icon-green) !important;
        width: 60px !important;
        height: 60px !important;
        margin-bottom: var(--space-4);
    }

    .success-icon i {
        font-size: 28px !important;
        color: #ffffff;
    }

    .success-title {
        font-size: var(--text-lg) !important;
        color: var(--navy-700) !important;
        line-height: 1.4 !important;
        margin-bottom: var(--space-2) !important;
    }

    .success-countdown {
        font-size: var(--text-sm) !important;
        color: var(--navy-300) !important;
        font-style: italic;
    }

    #countdownTime {
        font-weight: 700;
        color: var(--brand-dark-red);
    }

    /* --- CSS POPUP TẠO MẬT KHẨU --- */
    .password-header-icon {
        background-color: var(--brand-icon-green) !important;
    }

    /* ── MODAL PDF ── */
    .pdf-row {
        border-bottom: 1px solid rgba(26, 74, 122, 0.08);
        transition: background var(--duration) var(--ease-out);
    }

    .pdf-row:last-child {
        border-bottom: none;
    }

    .pdf-row:hover {
        background: var(--surface-muted);
    }

    .pdf-row td {
        padding: 20px 8px 20px 0;
        color: var(--navy-900);
        font-size: 14px;
        vertical-align: middle;
    }

    .pdf-row td:first-child {
        color: var(--brand-teal-dark);
        font-weight: 500;
    }

    .pdf-row td:nth-child(2) {
        color: var(--navy-300);
    }

    .btn-pdf-download {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border: none;
        background: none;
        cursor: pointer;
        color: var(--navy-500);
        border-radius: var(--radius-sm);
        transition: color var(--duration), background var(--duration);
        float: right;
    }

    .btn-pdf-download:hover {
        color: var(--brand-teal-dark);
        background: rgba(30, 77, 70, 0.08);
    }

    .btn-pdf-download svg {
        width: 22px;
        height: 22px;
        stroke: currentColor;
        fill: none;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    @media (max-width: 600px) {
        #pdfModal .profile-modal {
            padding: 24px 20px !important;
        }

        .pdf-row td {
            font-size: 12px;
            padding: 16px 6px 16px 0;
        }

        .pdf-row td:nth-child(2) {
            display: none;
        }
    }
