:root {
    --primary-orange: #d25e00;
    --hover-orange: #b84a00;
    --bg-light: #f8fafc;
    --card-bg: #f1f5f9;
    --text-main: #161616;
    --text-muted: #949494;
    --border-color: #e2e8f0;
    --icon-blue: #283c80;
    --icon-bg: #eaefff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Montserrat", sans-serif;
}

body {
    background-color: #f8fafc;
    color: var(--text-main);
    overflow-x: hidden;
}

/* ── HEADER ─────────────────────────────── */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 60px;
    background: #ffffff;
    box-shadow: 0px 0px 2px 0px rgba(94, 92, 92, 0.55);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

.logo {
    width: 200px;
    height: 79px;
}

.header-icons {
    display: flex;
    gap: 60px;
    color: var(--icon-blue);
    position: relative;
}

.header-icons svg {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.header-icons svg:hover {
    transform: scale(1.1);
}

/* ── MAIN ───────────────────────────────── */
main {
    max-width: 1700px;
    margin: 0 auto;
    padding: 60px 60px 80px;
    margin-top: 130px;
}

/* ── PAGE HEADER ────────────────────────── */
.page-title {
    font-size: 40px;
    font-weight: 600;
    color: #161616;
    line-height: 100%;
    letter-spacing: 0%;
    margin-bottom: 24px;
}

/* ── INTRO TEXT ─────────────────────────── */
.intro-text {
    font-size: 14px;
    font-weight: 400;
    color: #424343;
    line-height: 1.75;
    margin-bottom: 10px;
}

/* ── SECTION ────────────────────────────── */
.tc-section {
    margin-top: 36px;
}

.tc-section-title {
    font-size: 20px;
    font-weight: 600;
    color: #161616;
    line-height: 100%;
    letter-spacing: 0%;
    margin-bottom: 14px;
}

/* Sub-section heading (1.1, 1.2 etc.) */
.tc-subsection-title {
    font-size: 14px;
    font-weight: 600;
    color: #161616;
    margin-top: 16px;
    margin-bottom: 6px;
}

.tc-body {
    font-size: 14px;
    font-weight: 400;
    color: #424343;
    line-height: 1.75;
    margin-bottom: 10px;
}

.tc-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tc-list li {
    font-size: 14px;
    color: #424343;
    line-height: 1.7;
    padding-left: 16px;
    position: relative;
}

.tc-list li::before {
    content: "·";
    position: absolute;
    left: 0;
    color: #424343;
    font-size: 18px;
    line-height: 1.4;
}

/* Sub-item label + description inline */
.tc-subitem {
    margin-top: 12px;
}

.tc-subitem-label {
    font-size: 14px;
    font-weight: 400;
    color: #424343;
    padding-left: 16px;
    position: relative;
    margin-bottom: 2px;
}

.tc-subitem-label::before {
    content: "·";
    position: absolute;
    left: 0;
    color: #424343;
    font-size: 18px;
    line-height: 1.2;
}

.tc-subitem-desc {
    font-size: 14px;
    font-weight: 400;
    color: #424343;
    line-height: 1.7;
    padding-left: 0;
    margin-bottom: 4px;
}

.tc-email-link {
    color: var(--icon-blue);
    text-decoration: none;
    font-weight: 500;
}

.tc-email-link:hover {
    text-decoration: underline;
}

/* ── FOOTER ─────────────────────────────── */
footer {
    background: rgba(241, 245, 249, 1);
    border-top: 1px solid var(--border-color);
    padding: 40px 60px;
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-icons {
    display: flex;
    gap: 30px;
}

.footer-left p {
    font-size: 12px;
    color: rgba(71, 85, 105, 1);
    margin-top: 10px;
    padding-left: 16px;
    font-weight: 500;
}

.footer-links {
    display: flex;
    gap: 60px;
    font-size: 13px;
    font-weight: 500;
}

.footer-links a {
    text-decoration: none;
    color: var(--text-muted);
}

.footer-links a:hover {
    color: var(--text-main);
}

/* ── SCROLL TO TOP ──────────────────────── */
.scroll-to-top {
    position: fixed;
    bottom: 130px;
    right: 40px;
    width: 50px;
    height: 50px;
    background: var(--primary-orange);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 500;
    transition: all 0.3s ease;
}

.scroll-to-top.show {
    display: flex;
}

.scroll-to-top:hover {
    background: var(--hover-orange);
    transform: scale(1.1);
}

/* ── POPOVERS ───────────────────────────── */
.notifications-popover {
    background: rgba(241, 245, 249, 1);
    border-radius: 12px;
    width: min(320px, calc(100vw - 24px));
    box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    position: fixed;
    display: none !important;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease;
    padding-top: 8px !important;
}

.notifications-popover.active {
    display: block !important;
    visibility: visible;
    opacity: 1;
}

.notifications-list {
    max-height: min(400px, 50vh);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.notification-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px;
    margin: 0px 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.notification-item:hover {
    background-color: rgba(211, 211, 211, 0.515);
    border-radius: 8px;
}

.icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: white;
    border: 1px solid #eef0f7;
    border-radius: 50%;
    flex-shrink: 0;
}

.notification-content {
    display: flex;
    flex: 1;
    justify-content: space-between;
    align-items: center;
    min-width: 0;
}

.text-group {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.notification-text {
    font-size: 14px;
    font-weight: 400;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-time {
    font-size: 10px;
    color: #8892a0;
    white-space: nowrap;
}

.flag-icon {
    margin-top: 2px;
}

.notifications-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    background: rgba(241, 245, 249, 1);
}

.notifications-delete-all {
    display: none;
}

.notifications-manage {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    padding: 4px 0;
    font-family: "Montserrat", sans-serif;
}

.notifications-manage:hover {
    color: var(--text-main);
    text-decoration: underline;
}

/* Profile popover */
.profile-popover {
    background: rgba(241, 245, 249, 1);
    border-radius: 16px;
    padding: 16px;
    width: min(350px, calc(100vw - 24px));
    box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.25);
    text-align: center;
    position: fixed;
    display: none !important;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.profile-popover.active {
    display: block !important;
    visibility: visible;
    opacity: 1;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e1e8ff 0%, #e1e8ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 32px;
    color: var(--icon-blue);
    font-weight: 500;
}

.profile-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
}
.profile-phone {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.profile-email {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 4px;
    word-break: break-all;
}

.profile-address {
    color: var(--text-muted);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 6px;
    margin-bottom: 10px;
    margin-left: 0;
    padding: 0 8px;
    max-width: 100%;
}

.profile-address span {
    padding-top: 2px;
    font-size: 14px;
    text-align: center;
    line-height: 1.4;
    white-space: normal;
    word-break: break-word;
    min-width: 0;
}

.profile-address svg {
    flex-shrink: 0;
    margin-top: 3px;
}
.profile-divider {
    height: 1px;
    background: var(--border-color);
    margin: 5px 0;
}
.profile-menu-items {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 16px 13px 10px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 15px;
    font-weight: 400;
    color: var(--text-main);
    border: none;
    background: none;
    text-align: left;
    width: 100%;
    min-height: 44px;
}

.profile-menu-item:hover {
    background-color: rgba(211, 211, 211, 0.515);
    border-radius: 6px;
}
.profile-menu-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ── RESPONSIVE ─────────────────────────── */
@media (max-width: 1024px) {
    header {
        padding: 15px 30px;
    }
    .logo {
        width: 150px;
        height: 59px;
    }
    .header-icons {
        gap: 30px;
    }
    main {
        padding: 40px 30px 60px;
        margin-top: 110px;
    }
    footer {
        padding: 30px 30px;
    }
    .footer-links {
        gap: 30px;
    }
}

@media (max-width: 768px) {
    header {
        padding: 12px 20px;
    }
    .logo {
        width: 130px;
        height: 51px;
    }
    .header-icons {
        gap: 20px;
    }
    .header-icons svg {
        width: 22px;
        height: 22px;
    }
    main {
        padding: 30px 20px 50px;
        margin-top: 95px;
    }
    .page-title {
        font-size: 28px;
    }
    .tc-section-title {
        font-size: 17px;
    }
    footer {
        flex-direction: column;
        gap: 20px;
        padding: 24px 20px;
        align-items: center;
        text-align: center;
    }
    .footer-left {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .footer-left p {
        padding-left: 0;
    }
    .footer-icons {
        justify-content: center;
    }
    .footer-links {
        gap: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }
    /* Popovers — widths now fluid via min() in base rule */
    .profile-popover {
        padding: 14px;
        border-radius: 14px;
    }

    .profile-name {
        font-size: 16px;
    }

    .profile-phone,
    .profile-email {
        font-size: 13px;
    }

    .profile-address span {
        font-size: 13px;
    }

    .profile-menu-item {
        font-size: 14px;
        padding: 11px 14px 11px 8px;
    }

    .notifications-popover {
        border-radius: 10px;
    }

    .notification-text {
        font-size: 13px;
    }

    .notifications-footer {
        padding: 12px 16px;
    }

    .notifications-manage {
        font-size: 13px;
    }
    .scroll-to-top {
        bottom: 130px;
        right: 16px;
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 10px 16px;
    }
    .logo {
        width: 110px;
        height: 43px;
    }
    .header-icons {
        gap: 16px;
    }
    .header-icons svg {
        width: 20px;
        height: 20px;
    }
    main {
        padding: 24px 16px 40px;
        margin-top: 84px;
    }
    .page-title {
        font-size: 22px;
    }
    .tc-section-title {
        font-size: 15px;
    }
    .tc-body,
    .tc-list li,
    .intro-text,
    .tc-subitem-label,
    .tc-subitem-desc,
    .tc-subsection-title {
        font-size: 13px;
    }
    footer {
        padding: 20px 16px;
        gap: 16px;
    }
    .footer-links {
        gap: 14px;
        font-size: 12px;
    }

    /* Popovers — small phones */
    .profile-popover {
        padding: 12px;
        border-radius: 12px;
    }

    .profile-avatar {
        width: 64px;
        height: 64px;
        font-size: 26px;
        margin-bottom: 10px;
    }

    .profile-name {
        font-size: 15px;
    }

    .profile-phone,
    .profile-email,
    .profile-address span {
        font-size: 12px;
    }

    .profile-menu-item {
        font-size: 13px;
        padding: 10px 12px 10px 8px;
        min-height: 42px;
    }

    .profile-menu-item svg {
        width: 17px;
        height: 17px;
    }

    .notifications-popover {
        border-radius: 10px;
    }

    .notifications-list {
        max-height: 40vh;
    }

    .notification-item {
        padding: 10px 8px;
        gap: 10px;
    }

    .notification-text {
        font-size: 12px;
    }

    .notification-time {
        font-size: 10px;
    }

    .notifications-footer {
        padding: 10px 14px;
    }

    .notifications-manage {
        font-size: 12px;
    }

    /* Logout modal — small phones */
    .auth-logout-container {
        padding: 24px 16px;
        border-radius: 16px;
    }

    .auth-logout-icon-circle {
        width: 50px;
        height: 50px;
        margin-bottom: 14px;
    }

    .auth-logout-icon-circle i {
        font-size: 24px;
    }

    .auth-logout-title {
        font-size: 17px;
        margin-bottom: 10px;
    }

    .auth-logout-text {
        font-size: 13px;
        margin-bottom: 20px;
    }

    .auth-logout-actions {
        gap: 8px;
    }

    .auth-btn-cancel,
    .auth-btn-confirm {
        padding: 12px 8px;
        font-size: 13px;
        border-radius: 10px;
        min-height: 44px;
    }
}

/* ── LOGOUT MODAL ──────────────────────────────────── */
.auth-logout-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    font-family: "Montserrat", sans-serif;
}
.auth-logout-container {
    background-color: #f1f5f9;
    width: min(460px, calc(100vw - 32px));
    padding: 36px 28px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
}
.auth-logout-icon-circle {
    background-color: #e0e7ff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    flex-shrink: 0;
}
.auth-logout-icon-circle i {
    color: #283c80;
    font-size: 28px;
}
.auth-logout-title {
    color: #111;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}
.auth-logout-text {
    color: #5e6369;
    line-height: 1.6;
    font-size: 15px;
    margin-bottom: 24px;
}
.auth-logout-actions {
    display: flex;
    gap: 12px;
}
.auth-btn-cancel,
.auth-btn-confirm {
    flex: 1;
    padding: 13px 12px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background-color 0.25s ease;
    font-family: "Montserrat", sans-serif;
    min-height: 48px;
}
.auth-btn-cancel {
    background: transparent;
    color: #64748b;
    border: 1px solid #cbd5e1;
}
.auth-btn-confirm {
    background: #d25e00;
    color: #ffffff;
}
.auth-btn-confirm:hover {
    background-color: #b84a00;
}
.auth-btn-cancel:hover {
    background-color: #e2e8f0;
}
.auth-logout-backdrop.is-visible {
    display: flex;
}
/* ── END LOGOUT MODAL ──────────────────────────────── */
