/* =========================================================
   My account — safabrura.co.il
   Styling for the icredit-subscriptions [ics_my_subscription]
   shortcode. Scoped to .ics-my-subscription so it cannot leak
   into the plugin's other screens.
   ========================================================= */

.ics-my-subscription {
    max-width: 860px;
    margin: 0 auto;
    padding: 8px 0 24px;
    direction: rtl;
    font-family: var(--safa-ui);
    font-size: 16px;
    line-height: 1.6;
    color: var(--hd-ink);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ---------------------------------------------------------
   Hero — the one thing people come here to check
   --------------------------------------------------------- */

.acc-hero {
    position: relative;
    overflow: hidden;
    padding: 30px 32px;
    border: 1px solid var(--hd-line);
    border-radius: 22px;
    background: linear-gradient(150deg, #fdf6fa 0%, #f7f1fb 55%, #fff5ef 100%);
}
.acc-hero::before {
    content: "";
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--hd-accent), var(--hd-accent-2), #f0a875);
}
.acc-hero.is-inactive {
    background: linear-gradient(150deg, #faf7f9 0%, #f5f2f7 100%);
}

.acc-hero__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.acc-hero__eyebrow {
    margin: 0;
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: .06em;
    color: var(--hd-ink-soft);
}
.acc-hero__title {
    margin: 4px 0 0;
    font-family: var(--safa-display);
    font-size: 30px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--hd-ink);
}
.acc-hero__lead {
    margin: 16px 0 0;
    font-size: 16.5px;
    color: var(--hd-ink-soft);
    max-width: 52ch;
}
.acc-hero__lead strong {
    color: var(--hd-ink);
    font-weight: 600;
}
.acc-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.acc-badge {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 15px;
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
}
.acc-badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}
.acc-badge--on {
    color: #2f7d5b;
    background: rgba(47, 125, 91, .11);
    border: 1px solid rgba(47, 125, 91, .20);
}
.acc-badge--off {
    color: #93627f;
    background: rgba(147, 98, 127, .09);
    border: 1px solid rgba(147, 98, 127, .18);
}

/* Time left on the subscription */
.acc-meter {
    margin-top: 18px;
    max-width: 420px;
}
.acc-meter__bar {
    height: 7px;
    border-radius: 999px;
    background: rgba(92, 42, 77, .10);
    overflow: hidden;
}
.acc-meter__bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--hd-accent), var(--hd-accent-2));
}
.acc-meter.is-soon .acc-meter__bar span {
    background: linear-gradient(90deg, #d2694a, #c2588f);
}
.acc-meter__note {
    margin: 8px 0 0;
    font-size: 13.5px;
    color: var(--hd-ink-soft);
    font-variant-numeric: tabular-nums;
}
.acc-meter.is-soon .acc-meter__note {
    color: #b4573b;
}

/* The subscription's particulars */
.acc-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1px;
    margin: 24px 0 0;
    padding: 0;
    border: 1px solid var(--hd-line);
    border-radius: 16px;
    overflow: hidden;
    background: var(--hd-line);
}
.acc-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 15px 18px;
    background: rgba(255, 255, 255, .82);
}
.acc-stat dt {
    font-size: 12.5px;
    color: var(--hd-ink-soft);
}
.acc-stat dd {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--hd-ink);
    font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */

.acc-btn,
.ics-my-subscription .ics-button {
    display: inline-block;
    padding: 11px 28px;
    border-radius: 999px;
    font-size: 15.5px;
    font-weight: 500;
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease, color .2s ease, border-color .2s ease;
}
.acc-btn--primary,
.ics-my-subscription .ics-button {
    color: #fff !important;
    background: linear-gradient(120deg, var(--hd-accent), var(--hd-accent-2));
    box-shadow: 0 6px 18px rgba(194, 88, 143, .28);
}
.acc-btn--primary:hover,
.ics-my-subscription .ics-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(194, 88, 143, .38);
}
.acc-btn--ghost {
    color: var(--hd-ink);
    background: rgba(255, 255, 255, .85);
    border: 1px solid var(--hd-line);
}
.acc-btn--ghost:hover {
    color: var(--hd-accent);
    border-color: rgba(194, 88, 143, .35);
}

/* ---------------------------------------------------------
   Shortcuts
   --------------------------------------------------------- */

.acc-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}
.acc-link {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 16px 18px;
    border: 1px solid var(--hd-line);
    border-radius: 16px;
    background: #fff;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(92, 42, 77, .05);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.acc-link:hover {
    transform: translateY(-2px);
    border-color: rgba(194, 88, 143, .32);
    box-shadow: 0 12px 28px rgba(92, 42, 77, .12);
}
.acc-link__title {
    font-size: 16.5px;
    font-weight: 600;
    color: var(--hd-ink);
}
.acc-link:hover .acc-link__title {
    color: var(--hd-accent);
}
.acc-link__note {
    font-size: 13.5px;
    color: var(--hd-ink-soft);
}

/* ---------------------------------------------------------
   Cards and lists
   --------------------------------------------------------- */

.acc-card {
    padding: 24px 28px;
    border: 1px solid var(--hd-line);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 2px 12px rgba(92, 42, 77, .05);
}
.acc-card--alert {
    border-color: rgba(196, 96, 70, .28);
    background: linear-gradient(165deg, #fff8f5 0%, #fff 60%);
}
.acc-card__title {
    margin: 0 0 6px;
    font-family: var(--safa-display);
    font-size: 20px;
    font-weight: 600;
    color: var(--hd-ink);
}
.acc-card--alert .acc-card__title {
    color: #b4573b;
}
.acc-card__foot {
    margin: 16px 0 0;
    font-size: 14px;
    color: var(--hd-ink-soft);
}

.acc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.acc-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--hd-line);
}
.acc-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}
.acc-row__main {
    font-size: 16px;
    font-weight: 500;
    color: var(--hd-ink);
}
.acc-row__meta {
    font-size: 14px;
    color: var(--hd-ink-soft);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.acc-row__sep {
    padding: 0 2px;
    opacity: .6;
}
.acc-row__note {
    flex: 1 0 100%;
    font-size: 13.5px;
    color: #b4573b;
}
.acc-row .acc-chip {
    margin-inline-start: auto;
}

.acc-chip {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
}
.acc-chip--on {
    color: #2f7d5b;
    background: rgba(47, 125, 91, .11);
}
.acc-chip--off {
    color: var(--hd-ink-soft);
    background: rgba(92, 42, 77, .06);
}

.acc-empty {
    margin: 6px 0 0;
    color: var(--hd-ink-soft);
}

/* ---------------------------------------------------------
   Logged out
   --------------------------------------------------------- */

.ics-my-subscription .ics-my-subscription-login {
    max-width: 500px;
    margin: 0 auto;
    padding: 52px 40px;
    text-align: center;
    border: 1px solid var(--hd-line);
    border-radius: 22px;
    background: linear-gradient(165deg, #fdf8fb 0%, #f7f1fb 45%, #fff4ef 100%);
    box-shadow: 0 10px 34px rgba(92, 42, 77, .08);
}
.ics-my-subscription .ics-my-subscription-login .login-icon {
    width: 76px;
    height: 76px;
    margin: 0 auto 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 30px;
    background: #fff;
    border: 1px solid var(--hd-line);
    box-shadow: 0 8px 22px rgba(92, 42, 77, .10);
}
.ics-my-subscription .ics-my-subscription-login p {
    margin: 0 0 24px;
    color: var(--hd-ink-soft);
    font-size: 17px;
}

/* ---------------------------------------------------------
   Mobile
   --------------------------------------------------------- */

@media (max-width: 700px) {
    .acc-hero {
        padding: 24px 20px;
    }
    .acc-hero__title {
        font-size: 25px;
    }
    .acc-card {
        padding: 20px 18px;
    }
    .acc-stats {
        grid-template-columns: 1fr 1fr;
    }
    .acc-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }
    .acc-row .acc-chip {
        margin-inline-start: 0;
    }
    .acc-btn,
    .ics-my-subscription .ics-button {
        width: 100%;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .acc-btn,
    .acc-link,
    .ics-my-subscription .ics-button {
        transition: none !important;
    }
}

/* ---------------------------------------------------------
   Credits on the account page
   --------------------------------------------------------- */

.acc--credits {
    margin-top: 18px;
}
.acc-credits {
    padding: 20px 22px;
}
.acc-credits__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.acc-credits .acc-card__title {
    margin-bottom: 2px;
}
.acc-credits__count {
    margin: 0;
    font-size: 14px;
    color: var(--hd-ink-soft, #666);
}
.acc-credits__count strong {
    font-size: 30px;
    line-height: 1;
    color: #5b3a8c;
    margin-inline-end: 6px;
}
.acc-credits__note {
    margin: 8px 0 0;
    font-size: 13px;
    color: #777;
    line-height: 1.45;
}
.acc-tabs {
    margin-top: 14px;
}
.acc-tabs__bar {
    display: flex;
    gap: 4px;
    padding: 4px;
    border-radius: 12px;
    background: #f3eff8;
}
.acc-tabs__tab {
    flex: 1;
    border: 0;
    border-radius: 9px;
    background: none;
    padding: 8px 10px;
    font-size: 14px;
    font-family: inherit;
    color: #555;
    cursor: pointer;
}
.acc-tabs__tab[aria-selected="true"] {
    background: #fff;
    color: #5b3a8c;
    font-weight: 600;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .08);
}
.acc-tabs__n {
    display: inline-block;
    min-width: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(118, 75, 162, .12);
    font-size: 12px;
    line-height: 20px;
    margin-inline-start: 4px;
}
.acc-tabs__panel[hidden] {
    display: none;
}
.acc-tabs__panel {
    padding-top: 6px;
}
.acc-credits .acc-row {
    padding: 9px 0;
    gap: 2px 10px;
    font-size: 14px;
    flex-wrap: nowrap;
}
.acc-credits .acc-row__main {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    line-height: 1.35;
}
.acc-credits .acc-row__main a {
    color: var(--hd-ink, #222);
    text-decoration: none;
}
.acc-credits .acc-row__main a:hover {
    color: #5b3a8c;
    text-decoration: underline;
}
.acc-credits .acc-row__meta {
    flex: none;
    font-size: 12px;
    color: #888;
    white-space: nowrap;
}
.acc-credits__icon {
    flex: none;
    width: 22px;
    text-align: center;
    font-size: 13px;
}
.acc-credits__delta {
    flex: none;
    display: inline-block;
    min-width: 30px;
    font-weight: 700;
    font-size: 14px;
    text-align: center;
}
.acc-credits__delta.is-plus {
    color: #1a5c2a;
}
.acc-credits__delta.is-minus {
    color: #a1111f;
}
.acc-credits .acc-empty {
    font-size: 14px;
    color: #777;
    margin: 6px 0 0;
}
@media (max-width: 600px) {
    .acc-credits {
        padding: 16px 14px;
    }
    .acc-credits .acc-btn {
        width: 100%;
        text-align: center;
    }
}

/* ---------------------------------------------------------
   My details on the account page
   --------------------------------------------------------- */

.acc--details {
    margin-top: 18px;
}
.acc-details {
    padding: 20px 22px;
}
.acc-form__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
    margin-top: 10px;
}
.acc-form__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: #666;
}
.acc-form__field input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #d9d3e3;
    border-radius: 10px;
    font: inherit;
    font-size: 15px;
    color: #222;
    background: #fff;
}
.acc-form__field input:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(118, 75, 162, .15);
}
.acc-form__field input:disabled {
    background: #f6f4f9;
    color: #777;
}
.acc-form__field input.is-invalid {
    border-color: #c0392b;
}
.acc-form__field small,
.acc-form__channels small {
    font-size: 12px;
    color: #888;
}
.acc-form__channels {
    margin: 14px 0 0;
    padding: 12px 14px;
    border: 1px solid #ece7f3;
    border-radius: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    font-size: 14px;
}
.acc-form__channels legend {
    padding: 0 6px;
    font-size: 13px;
    color: #666;
}
.acc-form__channels label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.acc-form__channels small {
    flex-basis: 100%;
}
.acc-form__password {
    margin-top: 14px;
    border: 1px solid #ece7f3;
    border-radius: 12px;
    padding: 10px 14px;
}
.acc-form__password summary {
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #5b3a8c;
}
.acc-form__password .acc-form__grid {
    margin-top: 10px;
}
.acc-form__show {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 13px;
    color: #666;
}
.acc-form__msg {
    margin: 14px 0 0;
    padding: 9px 12px;
    border-radius: 9px;
    background: #eef7ee;
    color: #1a5c2a;
    font-size: 14px;
}
.acc-form__msg.is-error {
    background: #fde8ea;
    color: #a1111f;
}
.acc-form__actions {
    margin-top: 14px;
}
@media (max-width: 600px) {
    .acc-details {
        padding: 16px 14px;
    }
    .acc-form__grid {
        grid-template-columns: 1fr;
    }
    .acc-form__actions .acc-btn {
        width: 100%;
        text-align: center;
    }
}

/* ---------------------------------------------------------
   Account page: side tabs on desktop, pill strip on phones
   --------------------------------------------------------- */

.acct {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 26px;
    align-items: start;
    direction: rtl;
}
.acct__nav {
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    border: 1px solid var(--hd-line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 2px 12px rgba(92, 42, 77, .05);
}
.acct__tab {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: start;
    padding: 11px 14px;
    border: 0;
    border-radius: 12px;
    background: none;
    font: inherit;
    font-size: 15px;
    color: #555;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.acct__tab svg {
    width: 18px;
    height: 18px;
    flex: none;
    fill: currentColor;
    opacity: .75;
}
.acct__tab:hover {
    background: #f6f2fa;
    color: #5b3a8c;
}
.acct__tab[aria-selected="true"] {
    background: #f1ebf8;
    color: #5b3a8c;
    font-weight: 600;
}
.acct__tab[aria-selected="true"] svg {
    opacity: 1;
}
.acct__badge {
    margin-inline-start: auto;
    min-width: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(118, 75, 162, .12);
    color: #5b3a8c;
    font-size: 12px;
    line-height: 22px;
    text-align: center;
}
.acct__panel[hidden] {
    display: none;
}
.acct__panel > .acc,
.acct__panel .acc--credits,
.acct__panel .acc--details {
    margin-top: 0;
}
.acct__panel .acc-hero + .acc-links {
    margin-top: 16px;
}
.acct__panel .acc-card + .acc-card {
    margin-top: 16px;
}

@media (max-width: 860px) {
    .acct {
        display: block;
    }
    .acct__nav {
        position: sticky;
        top: 0;
        z-index: 5;
        flex-direction: row;
        gap: 6px;
        margin: 0 -16px 16px;
        padding: 10px 16px;
        border: 0;
        border-bottom: 1px solid var(--hd-line);
        border-radius: 0;
        box-shadow: none;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .acct__nav::-webkit-scrollbar {
        display: none;
    }
    .acct__tab {
        flex: none;
        width: auto;
        padding: 8px 14px;
        border-radius: 999px;
        background: #f3eff8;
        font-size: 14px;
        white-space: nowrap;
    }
    .acct__tab[aria-selected="true"] {
        background: #5b3a8c;
        color: #fff;
    }
    .acct__tab[aria-selected="true"] .acct__badge {
        background: rgba(255, 255, 255, .25);
        color: #fff;
    }
    .acct__tab svg {
        display: none;
    }
}
