/**
 * AC Appointments — Customer Portal Styles
 *
 * All selectors scoped under .ac-customer-portal
 */

.ac-customer-portal {
    --ac-cp-primary: #0073aa;
    --ac-cp-primary-hover: #005a87;
    --ac-cp-primary-light: #e8f4fc;
    --ac-cp-danger: #d63638;
    --ac-cp-danger-light: #fef2f2;
    --ac-cp-success: #00a32a;
    --ac-cp-success-light: #d4edda;
    --ac-cp-warning: #f0ad4e;
    --ac-cp-bg: #f9fafb;
    --ac-cp-card: #fff;
    --ac-cp-border: #dcdde1;
    --ac-cp-text: #1d2327;
    --ac-cp-text-muted: #646970;
    --ac-cp-radius: 10px;
    --ac-cp-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);

    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 16px;
    color: var(--ac-cp-text);
    line-height: 1.5;
    max-width: 640px;
    margin: 0 auto;
    padding: 20px 0;
}

.ac-customer-portal *, .ac-customer-portal *::before, .ac-customer-portal *::after {
    box-sizing: border-box;
}

/* ── Login ──────────────────────────────────────────────── */

.ac-cp-login {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}

.ac-cp-login-card {
    width: 100%;
    max-width: 400px;
    background: var(--ac-cp-card);
    border: 1px solid var(--ac-cp-border);
    border-radius: var(--ac-cp-radius);
    padding: 36px 32px;
    box-shadow: var(--ac-cp-shadow);
}

.ac-cp-login-header {
    text-align: center;
    margin-bottom: 28px;
}

.ac-cp-login-logo {
    /* ACSD - 48px was too timid for a logo with a wordmark under the picture. */
    max-height: 78px;
    width: auto;
    margin-bottom: 16px;
}

.ac-cp-login-header h2 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    color: var(--ac-cp-text);
}

.ac-cp-login-subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--ac-cp-text-muted);
}

/* ── Notices ────────────────────────────────────────────── */

.ac-cp-notice {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 20px;
}

.ac-cp-notice--error {
    background: var(--ac-cp-danger-light);
    color: var(--ac-cp-danger);
    border: 1px solid #fecaca;
}

.ac-cp-notice--success {
    background: var(--ac-cp-success-light);
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* ── Form Fields ────────────────────────────────────────── */

.ac-cp-field {
    margin-bottom: 20px;
}

.ac-cp-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--ac-cp-text);
    margin-bottom: 6px;
}

.ac-cp-field input[type="text"],
.ac-cp-field input[type="email"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--ac-cp-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 16px;
    color: var(--ac-cp-text);
    background: #fff;
    transition: border-color 0.15s;
}

.ac-cp-field input:focus {
    border-color: var(--ac-cp-primary);
    outline: 2px solid rgba(0, 115, 170, 0.15);
    outline-offset: 0;
}

.ac-cp-otp-input {
    text-align: center;
    font-size: 28px !important;
    font-weight: 700;
    letter-spacing: 8px;
    font-family: monospace;
}

.ac-cp-otp-info {
    text-align: center;
    font-size: 14px;
    color: var(--ac-cp-text-muted);
    margin: 0 0 20px;
}

.ac-cp-otp-actions {
    /* ACSD - flex row so the "Resend code" button and the "Use different
       email" link sit on one baseline; they used to drift because one is a
       <button> inside an inline <form> and the other a plain <a>. */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    font-size: 14px;
}

.ac-cp-otp-actions form {
    display: inline-flex;
    margin: 0;
}

/* ACSD - "Resend code" is a <button> so it can submit the resend form, and
   the site theme styles it as one: Elementor's kit emits rules like
   `.elementor-kit-7 button { background-color: ...; padding: ... }`, which is
   specificity (0,1,1) and beats this plugin's single `.ac-cp-link` class
   (0,1,0). The result was a filled green pill next to a plain text link.
   Raising specificity to button.ac-cp-link and forcing the reset makes it
   look like the link it is, whatever the host theme does. */
button.ac-cp-link {
    -webkit-appearance: none !important;
    appearance: none !important;
    background: none !important;
    background-color: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: var(--ac-cp-primary) !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: 0 !important;
    min-width: 0 !important;
    width: auto !important;
    height: auto !important;
    font-family: inherit !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: inherit !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    text-decoration: underline !important;
    text-shadow: none !important;
}

button.ac-cp-link:hover,
button.ac-cp-link:focus {
    background: none !important;
    background-color: transparent !important;
    box-shadow: none !important;
    color: var(--ac-cp-primary-hover) !important;
    text-decoration: underline !important;
}

.ac-cp-link {
    background: none;
    border: none;
    color: var(--ac-cp-primary);
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    text-decoration: underline;
    padding: 0;
}

.ac-cp-link:hover {
    color: var(--ac-cp-primary-hover);
}

.ac-cp-separator {
    color: var(--ac-cp-border);
    margin: 0 8px;
}

/* ── Buttons ────────────────────────────────────────────── */

.ac-cp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, opacity 0.15s;
}

.ac-cp-btn--primary {
    background: var(--ac-cp-primary);
    color: #fff;
}

.ac-cp-btn--primary:hover {
    background: var(--ac-cp-primary-hover);
}

.ac-cp-btn--outline {
    background: transparent;
    color: var(--ac-cp-text-muted);
    border: 1px solid var(--ac-cp-border);
}

.ac-cp-btn--outline:hover {
    background: var(--ac-cp-bg);
}

.ac-cp-btn--danger {
    background: var(--ac-cp-danger);
    color: #fff;
}

.ac-cp-btn--danger:hover {
    background: #b02a2d;
}

.ac-cp-btn--full {
    width: 100%;
}

.ac-cp-btn--small {
    padding: 6px 14px;
    font-size: 13px;
}

/* ── ACSD - Hold the button styling against the host theme ───
   A site theme (Elementor's kit in particular) emits
   `.elementor-kit-N button, ... { color; background-color; padding;
   font-size; text-transform }` at specificity (0,1,1), which beats this
   plugin's single classes (0,1,0). Repeating the class to (0,2,0) was not
   enough on test.healingtherapy.ro — the Cancel button still came out 44px
   tall against the 28px the plugin asks for — so the properties the theme
   actually fights over are forced.

   Only the properties the plugin OWNS are forced; margins, focus rings and
   anything else are still the theme's to set. Each variant restates its own
   border and colours, because the reset below clears them. */

button.ac-cp-btn.ac-cp-btn,
a.ac-cp-btn.ac-cp-btn {
    display: inline-flex !important;
    /* ACSD - forced: a theme line-height on <button> pushed the label off
       centre inside the full-width "Send code" button. */
    align-items: center !important;
    justify-content: center !important;
    gap: 6px;
    box-sizing: border-box;
    padding: 12px 24px !important;
    border: none;
    border-radius: 8px !important;
    font-family: inherit !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    text-decoration: none !important;
    text-shadow: none !important;
    box-shadow: none !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    min-width: 0 !important;
    cursor: pointer;
}

/* Size modifiers come after the base block, and must also be forced or the
   theme's padding wins again. */
button.ac-cp-btn--small.ac-cp-btn--small,
a.ac-cp-btn--small.ac-cp-btn--small {
    padding: 6px 14px !important;
    font-size: 13px !important;
}

button.ac-cp-btn--full.ac-cp-btn--full,
a.ac-cp-btn--full.ac-cp-btn--full {
    width: 100% !important;
}

button.ac-cp-btn--primary.ac-cp-btn--primary,
a.ac-cp-btn--primary.ac-cp-btn--primary {
    background: var(--ac-cp-primary) !important;
    color: #fff !important;
    border: none !important;
}

button.ac-cp-btn--primary.ac-cp-btn--primary:hover,
a.ac-cp-btn--primary.ac-cp-btn--primary:hover {
    background: var(--ac-cp-primary-hover) !important;
    color: #fff !important;
}

button.ac-cp-btn--danger.ac-cp-btn--danger,
a.ac-cp-btn--danger.ac-cp-btn--danger {
    background: var(--ac-cp-danger) !important;
    color: #fff !important;
    border: none !important;
}

button.ac-cp-btn--danger.ac-cp-btn--danger:hover,
a.ac-cp-btn--danger.ac-cp-btn--danger:hover {
    background: #b02a2d !important;
    color: #fff !important;
}

/* The outline variant is the one that MUST restate its border: the reset
   above clears it, which is what made "Sign Out" read as plain text. */
button.ac-cp-btn--outline.ac-cp-btn--outline,
a.ac-cp-btn--outline.ac-cp-btn--outline {
    background: transparent !important;
    color: var(--ac-cp-text-muted) !important;
    border: 1px solid var(--ac-cp-border) !important;
}

button.ac-cp-btn--outline.ac-cp-btn--outline:hover,
a.ac-cp-btn--outline.ac-cp-btn--outline:hover {
    background: var(--ac-cp-bg) !important;
    color: var(--ac-cp-text) !important;
    border-color: var(--ac-cp-text-muted) !important;
}

/* ── Portal Header ──────────────────────────────────────── */

.ac-cp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.ac-cp-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}

.ac-cp-logout-form {
    display: flex;
    align-items: center;
    gap: 12px;
    /* ACSD - pin the email + Sign Out to the right edge. justify-content on
       the header alone was not enough: a site theme that gives <form> its own
       width or margin leaves the block floating mid-row. */
    margin-left: auto;
    margin-right: 0;
    width: auto;
    max-width: none;
    justify-content: flex-end;
}

.ac-customer-portal .ac-cp-header {
    width: 100%;
}

@media screen and (max-width: 600px) {
    /* On a phone the heading takes the row and the account line sits under
       it, still right-aligned. */
    .ac-cp-logout-form {
        width: 100%;
    }
}

.ac-cp-user-email {
    font-size: 14px;
    color: var(--ac-cp-text-muted);
}

/* ── Section Titles ─────────────────────────────────────── */

.ac-cp-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--ac-cp-text);
    margin: 0 0 14px;
    padding: 0;
}

.ac-cp-section-title--toggle {
    cursor: pointer;
    user-select: none;
    padding: 10px 0;
    margin-top: 20px;
    color: var(--ac-cp-text-muted);
}

.ac-cp-section-title--toggle:hover {
    color: var(--ac-cp-text);
}

.ac-cp-past-section {
    margin-top: 8px;
}

/* ── Booking Cards ──────────────────────────────────────── */

.ac-cp-bookings {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ac-cp-booking-card {
    background: var(--ac-cp-card);
    border: 1px solid var(--ac-cp-border);
    border-radius: var(--ac-cp-radius);
    padding: 18px 20px;
    box-shadow: var(--ac-cp-shadow);
    transition: box-shadow 0.15s;
}

.ac-cp-booking-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ac-cp-booking-card--past {
    opacity: 0.7;
}

.ac-cp-booking-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.ac-cp-booking-ref {
    font-family: monospace;
    font-size: 13px;
    color: var(--ac-cp-text-muted);
    letter-spacing: 0.3px;
}

.ac-cp-booking-service {
    font-size: 17px;
    font-weight: 600;
    color: var(--ac-cp-text);
    margin-bottom: 8px;
}

.ac-cp-booking-details {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: 14px;
    color: var(--ac-cp-text-muted);
}

.ac-cp-booking-price {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--ac-cp-text);
}

.ac-cp-booking-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--ac-cp-border);
}

.ac-cp-action-hint {
    font-size: 13px;
    color: var(--ac-cp-text-muted);
    font-style: italic;
}

/* ── Badges ─────────────────────────────────────────────── */

.ac-cp-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.ac-cp-badge--pending {
    background: #fff3cd;
    color: #856404;
}

.ac-cp-badge--confirmed {
    background: #d4edda;
    color: #155724;
}

.ac-cp-badge--completed {
    background: var(--ac-cp-primary-light);
    color: var(--ac-cp-primary);
}

.ac-cp-badge--cancelled {
    background: #f8d7da;
    color: #721c24;
}

.ac-cp-badge--no-show {
    background: #e2e3e5;
    color: #383d41;
}

.ac-cp-badge--pay-none {
    background: #e2e3e5;
    color: #6c757d;
}

.ac-cp-badge--pay-pending {
    background: #fff3cd;
    color: #856404;
}

.ac-cp-badge--pay-paid {
    background: #d4edda;
    color: #155724;
}

.ac-cp-badge--pay-failed {
    background: #f8d7da;
    color: #721c24;
}

.ac-cp-badge--pay-refunded {
    background: #cce5ff;
    color: #004085;
}

/* ── Empty State ────────────────────────────────────────── */

.ac-cp-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--ac-cp-text-muted);
}

/* ── Responsive ─────────────────────────────────────────── */

@media screen and (max-width: 480px) {
    .ac-customer-portal {
        padding: 10px 0;
        font-size: 15px;
    }

    .ac-cp-login-card {
        padding: 28px 20px;
    }

    .ac-cp-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ac-cp-booking-details {
        flex-direction: column;
        gap: 4px;
    }

    .ac-cp-booking-actions {
        flex-wrap: wrap;
    }
}

/* ── ACSD - Cancel / Reschedule are POST forms now, not links ───
   Both actions run against the signed-in session, so each sits in its own
   <form>. Without this the forms would stack and the two buttons would no
   longer share a row. */
.ac-cp-inline-form {
    display: inline-flex;
    margin: 0;
    padding: 0;
}

/* ── ACSD - A stray <br> must never pad a button ──────────────
   The markup put the label on its own line inside <button>; once
   something runs wpautop over the shortcode output that newline becomes a
   <br>, and a <br> inside a flex button is a whole extra line box - which
   is the gap that appeared above "Trimite codul". The markup no longer has
   the newline; this is the guard in case autop reaches it another way. */
.ac-cp-btn br {
    display: none;
}

/* ACSD - Abonamentul, pe pagina clientului.
   Same card as a booking, with the one line that matters - how many sessions
   are left - carried in the accent colour, because that is the number the
   client opens this page for. */
.ac-cp-sub-card {
    border-left: 3px solid var(--ac-cp-primary, #0073aa);
}

.ac-cp-sub-left {
    font-weight: 700;
    color: var(--ac-cp-primary, #0073aa);
}

.ac-cp-sub-how {
    margin: 10px 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--ac-cp-text-muted);
}
