/* Certification detail page (pages/certification-detail.php). Loaded after certifications.css. */

/* Hero title: same typography as the course detail hero (.ceh-title / .ceh-title--accent in courses/course-template.php). */
.cert-detail .cert-hero h1.cert-title {
    max-width: 100% !important;
    margin: 0 0 18px;
    font-family: "Inter", "Poppins", system-ui, Arial, sans-serif;
    font-size: clamp(2rem, 3.8vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.08;
}
.cert-detail .cert-hero h1.cert-title .cert-title--accent {
    display: block;
    color: #5cc7cc;
    font-size: inherit;
    text-shadow: 0 8px 30px rgba(0, 212, 255, .08);
}
.cert-detail .cert-title-line { display: block; }
.cert-detail .cert-hero h1.cert-title + p { margin-top: 0; }

/* Hero saving: "20% Off" badge + amount */
.cert-saving { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cert-saving-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--pr-accent);
    color: var(--pr-accent-ink);
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .02em;
    line-height: 1.4;
    white-space: nowrap;
}
.cert-saving-amount { color: var(--pr-accent); }

/* Overview: its own section above the tabs */
.cert-overview-section { margin-bottom: 56px; }
.cert-overview-section .pr-content { max-width: none; }

/* Tabs: the panel scrolls like the course template's when the content is long. */
.cert-detail-tabs .tabs-panel-wrap { max-height: 640px; overflow: auto; }
.cert-detail-tabs .tabs-panel-wrap::-webkit-scrollbar { width: 10px; }
.cert-detail-tabs .tabs-panel-wrap::-webkit-scrollbar-thumb { border-radius: 10px; background: rgba(0, 212, 255, .12); }
.cert-detail-tabs .course-section.active { animation: cert-tab-in .22s ease; }
.cert-detail-tabs .pr-content { max-width: none; }
@keyframes cert-tab-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (min-width: 601px) and (max-width: 900px) {
    .cert-detail-tabs .tabs-container .tab-button { flex: 1 1 calc(50% - 8px); }
}

/* Rich text tables from the CMS (jobs and salary, exam and voucher information) */
.cert-rich-table {
    margin: 18px 0;
    overflow-x: auto;
    border: 1px solid var(--pr-line);
    border-radius: 12px;
    background: rgba(255, 255, 255, .015);
    -webkit-overflow-scrolling: touch;
}
.cert-rich-table:focus-visible { outline: 2px solid var(--pr-accent); outline-offset: 3px; }
.cert-rich-table:first-child { margin-top: 0; }
.cert-rich-table:last-child { margin-bottom: 0; }
.cert-page .cert-rich-table table {
    width: 100%;
    margin: 0;
    border: 0;
    border-collapse: collapse;
    color: #d3deec;
    font-size: .95rem;
    line-height: 1.55;
}
.cert-page .cert-rich-table th,
.cert-page .cert-rich-table td {
    padding: 14px 18px;
    border: 0;
    border-bottom: 1px solid var(--pr-line);
    background: none;
    color: inherit;
    text-align: left;
    vertical-align: top;
}
.cert-page .cert-rich-table tr > * + * { border-left: 1px solid var(--pr-line); }
.cert-page .cert-rich-table thead th,
.cert-page .cert-rich-table tr:first-child > th {
    background: rgba(101, 216, 209, .08);
    color: var(--pr-accent);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}
/* Label/value tables: the first column reads as the label. */
.cert-page .cert-rich-table tbody tr > :first-child:not(:only-child) { color: #fff; font-weight: 600; }
.cert-page .cert-rich-table tbody tr:nth-child(even) > * { background: rgba(255, 255, 255, .018); }
.cert-page .cert-rich-table tbody tr:hover > * { background: rgba(101, 216, 209, .05); }
.cert-page .cert-rich-table tr:last-child > * { border-bottom: 0; }
.cert-page .cert-rich-table p { margin: 0; }

/* Average jobs and salary */
.cert-careers { margin-top: 56px; }
.cert-careers-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 22px;
    align-items: start;
    padding: clamp(20px, 3vw, 32px);
    border: 1px solid rgba(101, 216, 209, .2);
    border-radius: var(--cert-radius);
    background: radial-gradient(ellipse 60% 90% at 100% 0%, rgba(101, 216, 209, .1), transparent 70%), var(--pr-panel);
}
.cert-careers-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(101, 216, 209, .12);
    color: var(--pr-accent);
    font-size: 1.4rem;
}
.cert-careers .pr-content { max-width: none; }
.cert-careers .pr-content > :first-child { margin-top: 0; }
.cert-careers .pr-content > :last-child { margin-bottom: 0; }

/* Exam and voucher information cards */
.cert-info-card { display: flex; flex-direction: column; padding: clamp(20px, 3vw, 28px); }
.cert-info-card h3 { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--pr-line); }
.cert-info-card h3 .bi {
    display: grid;
    flex: none;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(101, 216, 209, .12);
    color: var(--pr-accent);
    font-size: 1.1rem;
}
.cert-info-card .pr-content { max-width: none; font-size: .98rem; }
.cert-info-card .pr-content ul { padding-left: 1.2em; }
.cert-info-card .pr-content li + li { margin-top: 6px; }

@media (max-width: 600px) {
    .cert-careers-card { grid-template-columns: 1fr; gap: 14px; }
    .cert-careers-icon { width: 44px; height: 44px; font-size: 1.2rem; }
    .cert-page .cert-rich-table th, .cert-page .cert-rich-table td { padding: 12px 14px; }
    .cert-page .cert-rich-table table { font-size: .9rem; }
    .cert-saving-badge { font-size: .76rem; }
}

/* ---------- Enquiry modal ---------- */
.cert-enquiry-modal {
    --enquiry-bg: #060c16;
    --enquiry-panel: #0c1728;
    --enquiry-text: #eaf3ff;
    --enquiry-muted: #9cabc0;
    --enquiry-line: rgba(179, 205, 235, .15);
    --enquiry-accent: #65d8d1;
    --enquiry-accent-ink: #07151a;
    --pr-bg: var(--enquiry-bg);
    --pr-panel: var(--enquiry-panel);
    --pr-ink: var(--enquiry-text);
    --pr-muted: var(--enquiry-muted);
    --pr-line: var(--enquiry-line);
    --pr-accent: var(--enquiry-accent);
    --pr-accent-ink: var(--enquiry-accent-ink);
}
.cert-enquiry-modal .pr-button { align-self: stretch; font: inherit; font-weight: 600; cursor: pointer; }
.cert-enquiry-modal .cert-enquiry-submit { font-size: 14px; }
.cert-enquiry-modal .cert-enquiry-success .pr-button { align-self: center; }
.cert-enquiry-modal .modal-dialog {
    width: min(440px, calc(100% - 32px));
    max-width: 440px;
    margin: 16px auto;
}
.cert-enquiry-modal .modal-content {
    width: 100%;
    max-width: none;
    max-height: 90vh;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(101, 216, 209, .22);
    border-radius: 18px;
    background:
        radial-gradient(ellipse 75% 55% at 100% 0%, rgba(101, 216, 209, .12), transparent 70%),
        var(--enquiry-panel);
    color: var(--enquiry-text);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    margin: 0;
    text-align: left;
    animation: none;
}
.cert-enquiry-modal .modal-header {
    flex: 0 0 auto;
    align-items: flex-start;
    gap: 12px;
    padding: 22px 24px 16px;
    border-bottom: 1px solid var(--enquiry-line);
    background: radial-gradient(ellipse 70% 140% at 100% 0%, rgba(101, 216, 209, .1), transparent 70%);
}
.cert-enquiry-heading { min-width: 0; }
.cert-enquiry-modal .modal-title { margin: 0; color: #fff; font-size: 1.2rem; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.cert-enquiry-kicker { display: block; margin-bottom: 4px; color: var(--enquiry-accent); font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.cert-enquiry-subtitle { margin: 4px 0 0; color: var(--enquiry-muted); font-size: .84rem; line-height: 1.45; overflow-wrap: anywhere; }
.cert-enquiry-modal .btn-close { flex: none; margin: 0; opacity: .7; }
.cert-enquiry-modal .btn-close:hover { opacity: 1; }
.cert-enquiry-modal .modal-body { min-height: 0; padding: 18px 24px 24px; overflow-y: auto; overscroll-behavior: contain; }
.cert-enquiry-intro { margin: 0 0 18px; color: var(--enquiry-muted); font-size: .93rem; line-height: 1.6; }
.cert-enquiry-honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.cert-enquiry-grid { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 12px; }
.cert-enquiry-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cert-enquiry-field label { margin: 0; color: #c4d2e5; font-size: .84rem; font-weight: 600; }
.cert-enquiry-field label span { color: var(--enquiry-accent); }
.cert-enquiry-form input:not([type="hidden"]),
.cert-enquiry-form textarea {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--enquiry-line);
    border-radius: 9px;
    background: #060c16;
    color: #fff;
    font: inherit;
    font-size: 13px;
    transition: border-color .16s ease, box-shadow .16s ease;
}
.cert-enquiry-form textarea { height: auto; min-height: 86px; padding: 10px 12px; resize: vertical; }
.cert-enquiry-form input::placeholder, .cert-enquiry-form textarea::placeholder { color: #78889e; }
.cert-enquiry-form input:focus, .cert-enquiry-form textarea:focus {
    border-color: var(--enquiry-accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(101, 216, 209, .18);
}
.cert-enquiry-field.has-error input, .cert-enquiry-field.has-error textarea { border-color: #ff7b7b; }
.cert-enquiry-field.has-error input:focus, .cert-enquiry-field.has-error textarea:focus { box-shadow: 0 0 0 3px rgba(255, 123, 123, .18); }
.cert-enquiry-error { color: #ff9a9a; font-size: .8rem; line-height: 1.4; }
.cert-enquiry-error:empty { display: none; }

.cert-enquiry-alert { margin-bottom: 14px; padding: 10px 12px; border: 1px solid rgba(255, 123, 123, .35); border-radius: 9px; background: rgba(255, 123, 123, .08); color: #ffb3b3; font-size: .88rem; }
.cert-enquiry-alert[hidden] { display: none; }

/* Searchable country dropdown */
.cert-combobox { position: relative; }
.cert-enquiry-form .cert-combobox > input { padding-right: 38px; }
.cert-combobox > .bi { position: absolute; top: 50%; right: 14px; color: var(--enquiry-muted); font-size: .85rem; pointer-events: none; transform: translateY(-50%); }
.cert-combobox-options {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    z-index: 5;
    max-height: 230px;
    margin: 0;
    padding: 6px;
    overflow-y: auto;
    border: 1px solid rgba(101, 216, 209, .25);
    border-radius: 10px;
    background: var(--enquiry-panel);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .5);
    list-style: none;
}
.cert-combobox-options[hidden], .cert-combobox-options [hidden] { display: none; }
.cert-combobox-options [role="option"] {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 8px;
    color: #e3f1ff;
    font-size: .88rem;
    cursor: pointer;
}
.cert-combobox-options [role="option"] small { color: var(--enquiry-muted); }
.cert-combobox-options [role="option"]:hover, .cert-combobox-options [role="option"].is-active { background: rgba(101, 216, 209, .12); color: #fff; }
.cert-combobox-options [aria-selected="true"] { color: var(--enquiry-accent); font-weight: 600; }
.cert-combobox-empty { padding: 10px 12px; color: var(--enquiry-muted); font-size: .9rem; }

/* Phone with the selected country's dial code */
.cert-phone { display: flex; align-items: stretch; }
.cert-phone-code {
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid rgba(179, 205, 235, .2);
    border-right: 0;
    border-radius: 9px 0 0 9px;
    background: rgba(101, 216, 209, .08);
    color: var(--enquiry-accent);
    font-size: .92rem;
    font-weight: 600;
    white-space: nowrap;
}
.cert-phone-code[hidden] { display: none; }
.cert-enquiry-form .cert-phone-code:not([hidden]) + input { border-radius: 0 9px 9px 0; }

/* Submit with loading state */
.cert-enquiry-submit { justify-content: center; width: 100%; height: 46px; margin-top: 16px; padding: 0 12px; border: 1px solid var(--enquiry-accent); border-radius: 8px; background: var(--enquiry-accent); color: var(--enquiry-accent-ink) !important; font-size: 14px; }
.cert-enquiry-submit:hover { filter: brightness(1.04); }
.cert-enquiry-submit[disabled] { cursor: progress; opacity: .8; }
.cert-enquiry-spinner { display: none; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: cert-spin .7s linear infinite; }
.cert-enquiry-submit.is-loading .cert-enquiry-spinner { display: inline-block; }
@keyframes cert-spin { to { transform: rotate(360deg); } }

/* Success */
.cert-enquiry-success { padding: 16px 8px 8px; text-align: center; }
.cert-enquiry-success[hidden], .cert-enquiry-form[hidden] { display: none; }
.cert-enquiry-success-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; margin-bottom: 14px; border-radius: 50%; background: rgba(101, 216, 209, .14); color: var(--enquiry-accent); font-size: 2rem; }
.cert-enquiry-success h3 { margin: 0 0 8px; color: #fff; font-size: 1.25rem; font-weight: 700; }
.cert-enquiry-success p { max-width: 420px; margin: 0 auto 22px; color: #c4d2e5; line-height: 1.6; }
.cert-enquiry-success .pr-button { font: inherit; cursor: pointer; }

@media (max-width: 575px) {
    .cert-enquiry-modal .modal-dialog { width: calc(100% - 24px); margin: 12px auto; }
    .cert-enquiry-modal .modal-header { padding: 18px 18px 14px; }
    .cert-enquiry-modal .modal-body { padding: 16px 18px 20px; }
    .cert-enquiry-modal .modal-content { max-height: calc(100dvh - 24px); }
    /* 16px stops iOS Safari from zooming in when a field is focused. */
    .cert-enquiry-form input:not([type="hidden"]), .cert-enquiry-form textarea { font-size: 16px; }
    .cert-enquiry-form textarea { min-height: 80px; }
    .cert-combobox-options { max-height: 180px; }
}
@media (prefers-reduced-motion: reduce) {
    .cert-detail-tabs .course-section.active { animation: none; }
    .cert-enquiry-spinner { animation-duration: 1.6s; }
}
