:root {
    --text-main: #111111;
    --text-muted: #444444;
    --heading-green: #1b4332;
    --link-color: #111111;

    --bg-page: #f8faf8;
    --card-bg: #ffffff;
    --sub-card-bg: #f2f6f3;
    --border-line: #e3ebe5;
    --border-accent: #52b788;
    --emergency-bg: #fdfaf8;
    --emergency-border: #d4a373;
    --emergency-line: #ecdcd2;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-main);
    background-color: var(--bg-page);
}

/* ĐỊNH DẠNG EMAIL */
.plain-email {
    color: var(--heading-green);
    text-decoration: none !important;
    font-weight: 600;
    
    /* Cho phép chữ ngắt dòng linh hoạt khi gặp lề */
    overflow-wrap: anywhere; /* Chuẩn mới nhất, bẻ dòng tại bất kỳ ký tự nào khi cần */
    word-break: break-word;  /* Hỗ trợ các trình duyệt cũ hơn */
}

.header-email {
    color: var(--heading-green);
    text-decoration: none !important;
    font-weight: 400 !important;
}

/* KHUNG BỐ CỤC 2 CỘT */
.layout-wrapper {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: flex-start;
    padding: 40px 20px;
    gap: 40px;
}

/* THANH MENU DỌC BÊN TRÁI (SIDEBAR) */
.sidebar-nav {
    width: 150px;
    flex-shrink: 0;
    position: sticky;
    top: 40px;
    padding-top: 55px;
}

.sidebar-nav .nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-left: 2px solid var(--border-line);
    padding-left: 12px;
}

.sidebar-nav .nav-links a {
    font-size: 0.95rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
    display: block;
}

.sidebar-nav .nav-links a:hover {
    color: var(--heading-green);
    font-weight: 600;
    transform: translateX(3px);
}

/* NỘI DUNG CHÍNH BÊN PHẢI */
.content-main {
    flex: 1;
    min-width: 0;
}

/* CÁC Ô CARD */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-line);
    border-radius: 8px;
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(27, 67, 50, 0.03);
    scroll-margin-top: 30px;
}

.card h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--heading-green);
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-line);
    padding-bottom: 8px;
    text-align: left;
}

/* CĂN ĐỀU HAI BÊN CÁC ĐOẠN VĂN BẢN */
.card p {
    margin-bottom: 14px;
    color: var(--text-main);
    text-align: justify;
}

.card p:last-child {
    margin-bottom: 0;
}

/* Header Profile */
.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.profile-info h1 {
    font-size: 1.65rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--heading-green);
    margin-bottom: 6px;
    text-align: left;
}

.profile-info .subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 14px;
    text-align: left;
}

.contact-info p {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 4px;
    text-align: left;
}

/* Nút bấm mở ảnh kích thước lớn */
.image-trigger-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: zoom-in;
    line-height: 0;
    display: inline-block;
    border-radius: 6px;
}

.image-trigger-btn img {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border-line);
    transition: opacity 0.2s ease;
}

.image-trigger-btn:hover img {
    opacity: 0.88;
}

/* HỘP LIGHTBOX PHÓNG TO ẢNH TRỰC TIẾP TRÊN WEB */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(17, 24, 20, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-dialog {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    animation: lightboxFadeIn 0.2s ease-out;
}

@keyframes lightboxFadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.lightbox-img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    display: block;
}

.lightbox-close {
    position: absolute;
    top: -38px;
    right: 0;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
    transition: opacity 0.2s ease;
}

.lightbox-close:hover {
    opacity: 0.75;
}

/* Trạng thái */
.availability-notice {
    background-color: var(--sub-card-bg);
    border-left: 5px solid var(--border-accent);
    padding: 16px 20px;
}

.availability-notice p {
    margin: 0;
    color: var(--text-main);
    font-size: 0.95rem;
    text-align: left;
}

/* TÌNH HUỐNG KHẨN CẤP */
.emergency-notice {
    background-color: var(--emergency-bg);
    border: 1px solid #f2e2d8;
    border-left: 5px solid var(--emergency-border);
}

.emergency-notice h2 {
    color: #8c4a22;
    border-bottom-color: #f2e2d8;
}

.emergency-details {
    margin-top: 14px;
    border: 1px solid #ebd4c7;
    border-radius: 6px;
    background-color: #ffffff;
    overflow: hidden;
}

summary.emergency-summary {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 12px 14px;
    font-size: 0.92rem;
    font-weight: 600;
    color: #8c4a22;
    cursor: pointer;
    list-style: none !important;
    user-select: none;
    background-color: #fdfaf8;
    transition: background-color 0.2s ease;
}

summary.emergency-summary:hover {
    background-color: #f8efea;
}

summary.emergency-summary::-webkit-details-marker,
summary.emergency-summary::marker {
    display: none !important;
}

.emergency-toggle-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 1px solid #d4a373;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.emergency-toggle-btn::before {
    content: "";
    position: absolute;
    width: 10px;
    height: 2px;
    background-color: #8c4a22;
    border-radius: 1px;
}

.emergency-toggle-btn::after {
    content: "";
    position: absolute;
    width: 2px;
    height: 10px;
    background-color: #8c4a22;
    border-radius: 1px;
    transition: transform 0.2s ease;
}

details[open] .emergency-toggle-btn::after {
    transform: rotate(90deg);
    opacity: 0;
}

/* KHỐI SỐ ĐIỆN THOẠI KHẨN CẤP: NỀN TRẮNG, VIỀN THANH */
.emergency-subcard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
    background-color: #ffffff;
    border-top: 1px solid #ebd4c7;
}

.emergency-sub-card {
    background-color: #ffffff;
    border: 1px solid var(--emergency-line);
    border-radius: 6px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.emergency-name {
    font-size: 0.88rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #8c4a22;
    text-align: left;
}

.emergency-sub-card .sub-card-note {
    font-size: 0.82rem;
    color: #55443b;
    line-height: 1.45;
    margin: 0;
    text-align: left;
}

.emergency-phone {
    font-size: 0.95rem;
    font-weight: 700;
    color: #a33b1b;
    text-align: left;
    margin-top: 3px;
}

/* LƯỚI THÔNG TIN CHUNG */
.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.sub-card {
    background-color: var(--sub-card-bg);
    border: 1px solid var(--border-line);
    border-radius: 6px;
    padding: 12px 14px;
}

.sub-card h3 {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--heading-green);
    margin-bottom: 3px;
    text-align: left;
}

.sub-card p {
    font-size: 0.93rem;
    margin: 0;
    text-align: left;
    color: var(--text-main);
}

/* Đào tạo / Học vấn */
.education-item {
    margin-bottom: 14px;
}

.education-item:last-child {
    margin-bottom: 0;
}

.education-item h3 {
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--heading-green);
    margin-bottom: 2px;
    text-align: left;
}

.education-item .institution {
    font-size: 0.92rem;
    color: var(--text-main);
    margin-bottom: 2px;
    text-align: left;
}

.edu-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2px;
    text-align: left;
}

/* Chi phí */
.fee-levels {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

.fee-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 10px 14px;
    background-color: var(--sub-card-bg);
    border: 1px solid var(--border-line);
    border-radius: 6px;
    gap: 16px;
}

.fee-item.highlight {
    border-style: dashed;
    border-color: var(--border-accent);
}

.fee-range {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
    white-space: nowrap;
}

.fee-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: right;
}

.footnote {
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: left !important;
}

.monthly-estimate {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-line);
}

.monthly-estimate h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--heading-green);
    margin-bottom: 12px;
    text-align: left;
}

.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border-line);
    border-radius: 6px;
    background-color: #ffffff;
    margin-top: 14px;
}

.fee-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

.fee-table th, 
.fee-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-line);
}

.fee-table th {
    background-color: var(--sub-card-bg);
    color: var(--heading-green);
    font-weight: 600;
    line-height: 1.4;
}

.fee-table th small {
    font-size: 0.8rem;
    font-weight: normal;
    color: var(--text-muted);
}

.fee-table td {
    color: var(--text-main);
}

.fee-table tbody tr:last-child td {
    border-bottom: none;
}

.fee-table .highlight-row {
    background-color: #fafdfb;
}

/* QUY TRÌNH TIẾP NHẬN */
.process-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

details.step-item {
    background-color: var(--sub-card-bg);
    border: 1px solid var(--border-line);
    border-radius: 8px;
    overflow: hidden;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

details.step-item:hover {
    border-color: #cbd5e1;
    background-color: #ecf3ee;
}

details.step-item[open] {
    background-color: var(--sub-card-bg);
    border-color: #bbf7d0;
}

summary.step-summary {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 16px 18px;
    cursor: pointer;
    list-style: none !important;
    user-select: none;
}

summary.step-summary::-webkit-details-marker,
summary.step-summary::marker {
    display: none !important;
}

summary.step-summary h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--heading-green);
    margin: 0;
    padding-right: 14px;
    line-height: 1.4;
    text-align: left;
    transition: color 0.15s ease;
}

summary.step-summary:hover h3 {
    color: #0f291e;
}

.step-toggle-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 1px solid var(--border-line);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.step-toggle-btn::before {
    content: "";
    position: absolute;
    width: 12px;
    height: 2px;
    background-color: var(--heading-green);
    border-radius: 2px;
}

.step-toggle-btn::after {
    content: "";
    position: absolute;
    width: 2px;
    height: 12px;
    background-color: var(--heading-green);
    border-radius: 2px;
    transition: transform 0.2s ease;
}

summary.step-summary:hover .step-toggle-btn {
    background-color: var(--heading-green);
}
summary.step-summary:hover .step-toggle-btn::before,
summary.step-summary:hover .step-toggle-btn::after {
    background-color: #ffffff;
}

details[open] .step-toggle-btn::after {
    transform: rotate(90deg);
    opacity: 0;
}

.step-body {
    padding: 0 18px 18px 18px;
    border-top: 1px dashed var(--border-line);
    padding-top: 14px;
    margin-top: 2px;
}

.step-body p {
    font-size: 0.95rem;
    line-height: 1.65;
    margin-bottom: 10px;
    text-align: justify;
    color: var(--text-main);
}

.step-body p:last-child {
    margin-bottom: 0;
}

/* Ô BẮT ĐẦU CUỘC TRÒ CHUYỆN */
.cta-card {
    text-align: center;
    background-color: var(--sub-card-bg);
    border: 1px solid var(--border-accent);
    padding: 32px 24px;
}

.cta-card h2 {
    text-align: center;
    border-bottom: none;
    padding-bottom: 0;
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.cta-card p {
    text-align: center;
    max-width: 580px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Danh sách khó khăn */
.concerns-list {
    margin-left: 20px;
    margin-top: 8px;
    color: var(--text-main);
    text-align: left;
}

.concerns-list li {
    margin-bottom: 6px;
    line-height: 1.6;
    text-align: left;
}

/* Chân trang */
.site-footer {
    margin-top: 36px;
    padding-top: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

.site-footer p {
    margin-bottom: 4px;
}

/* TỐI ƯU MÀN HÌNH DI ĐỘNG (< 820px) */
@media (max-width: 820px) {
    .layout-wrapper {
        flex-direction: column;
        padding: 0;
        gap: 0;
    }

    .sidebar-nav {
        width: 100%;
        position: sticky;
        top: 0;
        z-index: 100;
        background-color: rgba(248, 250, 248, 0.94);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border-bottom: 1px solid var(--border-line);
        padding: 10px 14px;
        padding-top: 10px;
    }

    .sidebar-nav .nav-links {
        flex-direction: row;
        border-left: none;
        padding-left: 0;
        overflow-x: auto;
        gap: 8px;
        justify-content: flex-start;
        scrollbar-width: none;
    }

    .sidebar-nav .nav-links::-webkit-scrollbar {
        display: none;
    }

    .sidebar-nav .nav-links a {
        font-size: 0.85rem;
        white-space: nowrap;
        padding: 4px 6px;
    }

    .sidebar-nav .nav-links a:hover {
        transform: none;
    }

    .content-main {
        padding: 16px 12px 32px 12px;
    }

    .card {
        padding: 20px 16px;
        margin-bottom: 16px;
        scroll-margin-top: 55px;
    }

    .profile-header {
        flex-direction: column-reverse;
        text-align: center;
        gap: 16px;
    }

    .profile-info h1,
    .profile-info .subtitle,
    .contact-info p {
        text-align: center;
    }

    .image-trigger-btn img {
        width: 120px;
        height: 120px;
    }

    .details-grid {
        grid-template-columns: 1fr;
    }

    .fee-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .fee-desc {
        text-align: left;
    }

    .fee-table th, 
    .fee-table td {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
}
