/**
 * Agree Terms Before Order for WHMCS
 *
 * Client area styling for the agreement acceptance page.
 * Written mobile first; all interactive controls are keyboard accessible.
 */

.atc-page {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 0 40px;
}

/* Progress ---------------------------------------------------------------- */
.atc-progress {
    margin: 0 0 22px;
}

.atc-progress-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 0 0 8px;
    font-size: 13px;
    color: #5b6169;
}

.atc-progress-count {
    font-weight: 700;
    color: #2e7d32;
}

.atc-progress-track {
    height: 10px;
    background: #e8eaee;
    border-radius: 6px;
    overflow: hidden;
}

.atc-progress-bar {
    height: 100%;
    width: 0;
    background: #4caf50;
    border-radius: 6px;
    transition: width .25s ease;
}

.atc-progress-bar.is-partial {
    background: #f0ad4e;
}

/* Agreement panels -------------------------------------------------------- */
.atc-panel {
    border: 1px solid #e1e4e9;
    border-radius: 4px;
    background: #fff;
    margin: 0 0 16px;
    overflow: hidden;
}

.atc-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 18px;
    background: #f2f4f7;
    border-bottom: 1px solid #e1e4e9;
}

.atc-panel.is-open .atc-panel-head {
    border-bottom-color: #e1e4e9;
}

.atc-panel-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #2f343a;
}

.atc-panel-meta {
    margin: 4px 0 0;
    font-size: 12px;
    color: #7b818a;
}

.atc-panel-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.atc-status {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
}

.atc-status-pending {
    background: #fff4dd;
    color: #a6700f;
}

.atc-status-accepted {
    background: #e3f5e5;
    color: #2e7d32;
}

.atc-toggle {
    width: 32px;
    height: 32px;
    border: 1px solid #d3d7dd;
    border-radius: 4px;
    background: #fff;
    color: #4a4f57;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
}

.atc-toggle:hover,
.atc-toggle:focus {
    border-color: #2c7fc4;
    color: #2c7fc4;
}

.atc-panel-body {
    padding: 20px 22px;
    font-size: 14px;
    line-height: 1.7;
    color: #2f343a;
}

.atc-panel.is-collapsed .atc-panel-body {
    display: none;
}

.atc-panel-body table {
    border-collapse: collapse;
    width: 100%;
    margin: 14px 0;
}

.atc-panel-body td,
.atc-panel-body th {
    border: 1px solid #e1e4e9;
    padding: 9px 11px;
}

.atc-panel-body img {
    max-width: 100%;
    height: auto;
}

/* Consent ----------------------------------------------------------------- */
.atc-consent {
    padding: 14px 22px;
    background: #eaf3fb;
    border-top: 1px solid #d3e4f3;
}

.atc-consent label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1d4f78;
    cursor: pointer;
}

.atc-consent input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    flex-shrink: 0;
}

.atc-consent .atc-required {
    color: #b3261e;
    font-weight: 700;
}

/* Actions ----------------------------------------------------------------- */
.atc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin: 22px 0 0;
}

.atc-btn {
    display: inline-block;
    padding: 11px 22px;
    border: 1px solid #2c7fc4;
    border-radius: 4px;
    background: #2c7fc4;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.atc-btn:hover,
.atc-btn:focus {
    background: #256ea9;
    border-color: #256ea9;
    color: #fff;
    text-decoration: none;
}

.atc-btn-primary {
    background: #4caf50;
    border-color: #4caf50;
}

.atc-btn-primary:hover,
.atc-btn-primary:focus {
    background: #43a047;
    border-color: #43a047;
}

.atc-btn-secondary {
    background: #fff;
    color: #4a4f57;
    border-color: #ccd0d6;
}

.atc-btn-secondary:hover,
.atc-btn-secondary:focus {
    background: #f4f6f8;
    color: #2c7fc4;
    border-color: #b9bfc7;
}

.atc-btn[disabled],
.atc-btn[aria-disabled="true"] {
    opacity: .55;
    cursor: not-allowed;
}

/* Notices ----------------------------------------------------------------- */
.atc-notice {
    padding: 13px 16px;
    border-radius: 4px;
    margin: 0 0 18px;
    font-size: 14px;
    border: 1px solid transparent;
}

.atc-notice-ok {
    background: #e8f6e9;
    border-color: #c2e3c4;
    color: #2e7d32;
}

.atc-notice-warn {
    background: #fff8e6;
    border-color: #f0dfae;
    color: #8a6116;
}

.atc-notice-error {
    background: #fdecea;
    border-color: #f3cbc7;
    color: #b3261e;
}

.atc-notice-info {
    background: #eaf3fb;
    border-color: #cbe0f2;
    color: #1d6fb8;
}

.atc-notice ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.atc-help {
    margin: 10px 0 0;
    font-size: 12px;
    color: #7b818a;
}

/* Cart notice ------------------------------------------------------------- */
.atc-cart-notice {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    margin: 0 0 20px;
    border: 1px solid #cbe0f2;
    border-left: 4px solid #2c7fc4;
    border-radius: 4px;
    background: #f4f9fd;
}

.atc-cart-notice.is-done {
    border-color: #c2e3c4;
    border-left-color: #4caf50;
    background: #f3faf3;
}

.atc-cart-notice-text {
    flex: 1 1 320px;
    font-size: 14px;
    color: #2f343a;
}

.atc-cart-notice-title {
    display: block;
    margin: 0 0 4px;
    font-weight: 700;
    color: #1d4f78;
}

.atc-cart-notice.is-done .atc-cart-notice-title {
    color: #2e7d32;
}

/* Print ------------------------------------------------------------------- */
@media print {
    .atc-actions,
    .atc-toggle,
    .atc-progress,
    .atc-cart-notice {
        display: none !important;
    }

    .atc-panel {
        border-color: #999;
        page-break-inside: avoid;
    }

    .atc-panel-body {
        display: block !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .atc-consent {
        background: none;
        border-top: 1px dashed #999;
    }
}

@media (max-width: 640px) {
    .atc-panel-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .atc-panel-right {
        width: 100%;
        justify-content: space-between;
    }

    .atc-actions .atc-btn {
        width: 100%;
        text-align: center;
    }
}

/* Brand ------------------------------------------------------------------- */
.atc-brand {
    align-items: center;
    justify-content: flex-start;
    padding: 14px 18px;
    margin: 0 0 20px;
    background: #000000;
    border-radius: 4px;
}

.atc-brand-logo {
    display: block;
    width: 210px;
    height: auto;
    max-width: 60%;
}

@media print {
    .atc-brand {
        background: #ffffff;
        padding: 0 0 12px;
        border-bottom: 1px solid #999;
    }

    .atc-brand-logo {
        /* Keep the wordmark legible on white paper. */
        filter: invert(1) hue-rotate(180deg);
    }
}

/* ==========================================================================
   Inline prompt, product chip and review dialog
   --------------------------------------------------------------------------
   Theme neutral by design. Surfaces are drawn from the inherited text colour
   at low alpha, so the same markup reads correctly on a light theme, a dark
   theme and everything in between. Only the accent is explicit, and that is
   always paired with its own foreground colour so contrast stays controlled.
   ========================================================================== */
.atc-inline,
.atc-chip,
.atc-modal {
    --atc-accent: #2c7fc4;
    --atc-accent-ink: #ffffff;
}

/* Prompt next to the primary action button ------------------------------- */
.atc-inline {
    container-type: inline-size;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    width: 100%;
    margin: 14px 0;
    padding: 13px 15px;
    box-sizing: border-box;
    clear: both;
    color: inherit;
    background: rgba(127, 127, 127, .09);
    border: 1px solid rgba(127, 127, 127, .22);
    border-left: 4px solid var(--atc-accent);
    border-radius: 8px;
}

.atc-inline[data-atc-scheme="dark"] {
    background: rgba(255, 255, 255, .07);
    border-color: rgba(255, 255, 255, .18);
}

.atc-inline.is-done {
    border-left-color: #2e9e5b;
}

.atc-inline-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 50%;
    background: var(--atc-accent);
    color: var(--atc-accent-ink);
}

.atc-inline.is-done .atc-inline-icon {
    background: #2e9e5b;
}

.atc-inline-main {
    flex: 1 1 150px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.atc-inline-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    color: inherit;
    word-break: break-word;
}

.atc-inline-sub {
    font-size: 12px;
    line-height: 1.4;
    opacity: .72;
    word-break: break-word;
}

.atc-inline-btn {
    flex: 0 0 auto;
    margin-left: auto;
    padding: 10px 18px;
    border: 0;
    border-radius: 6px;
    background: var(--atc-accent);
    color: var(--atc-accent-ink);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    min-height: 42px;
}

.atc-inline-btn:hover,
.atc-inline-btn:focus {
    filter: brightness(.93);
}

.atc-inline.is-done .atc-inline-btn {
    background: #2e9e5b;
}

/* Narrow containers (for example a cart summary sidebar) get a full width
   button on its own line instead of a squashed one. */
@container (max-width: 360px) {
    .atc-inline-btn {
        flex: 1 1 100%;
        margin-left: 0;
    }
}

@media (max-width: 560px) {
    .atc-inline-btn {
        flex: 1 1 100%;
        margin-left: 0;
    }
}

/* Product card prompt ----------------------------------------------------- */
.atc-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 6px 0;
    padding: 6px 12px;
    border: 1px solid rgba(127, 127, 127, .3);
    border-radius: 16px;
    background: rgba(127, 127, 127, .1);
    color: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
    vertical-align: middle;
    min-height: 32px;
}

.atc-chip:hover,
.atc-chip:focus {
    border-color: var(--atc-accent);
    color: var(--atc-accent);
}

.atc-chip-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--atc-accent);
    flex-shrink: 0;
}

/* Review dialog ----------------------------------------------------------- */
html.atc-modal-open {
    overflow: hidden;
}

.atc-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.atc-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .55);
}

.atc-modal-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #ffffff;
    color: #2f343a;
    box-shadow: 0 18px 48px rgba(15, 23, 42, .28);
}

.atc-modal-panel[data-atc-scheme="dark"] {
    background: #171b21;
    color: #e7eaee;
}

.atc-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    flex-shrink: 0;
    background: rgba(127, 127, 127, .1);
    border-bottom: 1px solid rgba(127, 127, 127, .24);
}

.atc-modal-title {
    font-size: 15px;
    font-weight: 700;
    color: inherit;
}

.atc-modal-close {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: 1px solid rgba(127, 127, 127, .35);
    border-radius: 6px;
    background: transparent;
    color: inherit;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.atc-modal-close:hover,
.atc-modal-close:focus {
    border-color: var(--atc-accent);
    color: var(--atc-accent);
}

.atc-modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 18px;
}

.atc-modal-group {
    border: 1px solid rgba(127, 127, 127, .24);
    border-radius: 8px;
    margin: 0 0 16px;
    overflow: hidden;
}

.atc-modal-group-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(127, 127, 127, .1);
    border-bottom: 1px solid rgba(127, 127, 127, .24);
}

.atc-modal-group-title {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: inherit;
}

.atc-modal-group-meta {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    opacity: .72;
}

.atc-modal-group-content {
    padding: 16px;
    font-size: 14px;
    line-height: 1.7;
    color: inherit;
    max-height: 46vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.atc-modal-group-content table {
    border-collapse: collapse;
    width: 100%;
}

.atc-modal-group-content td,
.atc-modal-group-content th {
    border: 1px solid rgba(127, 127, 127, .3);
    padding: 8px;
}

.atc-modal-group-content img {
    max-width: 100%;
    height: auto;
}

.atc-modal-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 13px 14px;
    background: rgba(127, 127, 127, .12);
    border-top: 1px solid rgba(127, 127, 127, .24);
    font-size: 14px;
    font-weight: 600;
    color: inherit;
    cursor: pointer;
}

.atc-modal-consent input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 1px 0 0;
    flex-shrink: 0;
    accent-color: var(--atc-accent);
}

.atc-modal-foot {
    flex-shrink: 0;
    padding: 14px 18px;
    background: rgba(127, 127, 127, .1);
    border-top: 1px solid rgba(127, 127, 127, .24);
}

.atc-modal-message {
    margin: 0 0 10px;
    font-size: 13px;
    color: inherit;
    opacity: .8;
}

.atc-modal-message:empty {
    display: none;
}

.atc-modal-message.is-error {
    color: #e5534b;
    opacity: 1;
    font-weight: 600;
}

.atc-modal-message.is-ok {
    color: #2e9e5b;
    opacity: 1;
    font-weight: 600;
}

.atc-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.atc-modal-actions .atc-btn {
    width: 100%;
    text-align: center;
}

.atc-btn-primary {
    background: var(--atc-accent);
    border-color: var(--atc-accent);
    color: var(--atc-accent-ink);
}

.atc-btn-primary:hover,
.atc-btn-primary:focus {
    background: var(--atc-accent);
    border-color: var(--atc-accent);
    color: var(--atc-accent-ink);
    filter: brightness(.93);
}

.atc-modal-actions .atc-btn-secondary {
    background: transparent;
    border-color: rgba(127, 127, 127, .4);
    color: inherit;
}

.atc-modal-actions .atc-btn-secondary:hover,
.atc-modal-actions .atc-btn-secondary:focus {
    border-color: var(--atc-accent);
    color: var(--atc-accent);
    background: transparent;
}

.atc-modal .atc-status-pending,
.atc-modal .atc-status-accepted {
    border: 1px solid currentColor;
    background: transparent;
}

@media (min-width: 720px) {
    .atc-modal {
        align-items: center;
        padding: 32px 20px;
    }

    .atc-modal-panel {
        width: 100%;
        max-width: 780px;
        height: auto;
        max-height: 88vh;
        border-radius: 10px;
    }

    .atc-modal-actions {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }

    .atc-modal-actions .atc-btn {
        width: auto;
    }

    .atc-modal-actions [data-agree-terms-accept] {
        order: -1;
    }
}

@media print {
    .atc-inline,
    .atc-chip,
    .atc-modal {
        display: none !important;
    }
}

/* Print: agreement only -----------------------------------------------------
   The agreements are printed from a hidden frame (see atcPrintAgreements), so
   these rules apply to that frame's document as well. Each panel is kept whole
   on one page and the collapse control is left out. */
@media print {
    /* atc-print-baseline */
    .atc-panel,
    .atc-modal-group {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .atc-toggle {
        display: none !important;
    }
}
