/* ==========================================================================
   DRA3 X DRA3 campaign pages (Helpers/Dra3Campaign: the battlefy and dra3xdra3 clients only).
   _Layout loads this file only on those pages and adds .sso-body--dra3. Ported from prototype/dra3/style.css onto
   the SSO's own classes, so sso.js (loading buttons, length checks, terms) keeps working.
   ========================================================================== */

/* Cairo, the prototype's font. --sso-font already lists it first, so declaring it is enough. */
@font-face {
    font-family: 'Cairo';
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/cairo-ar.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
    font-family: 'Cairo';
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/cairo-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* hidden wins over the components' own display (sso-btn is inline-flex), so sso.js can swap buttons. */
.sso-body--dra3 [hidden] { display: none !important; }

/* Card: narrower, the banner on top instead of the client's logo. */
/* Card centred on the screen (vertically too); on phones it fills the screen instead (see the mobile block). */
.sso-body--dra3 .sso-main { padding: 24px 16px; align-items: center; }
.sso-body--dra3 .sso-card,
.sso-body--dra3 .sso-card.sso-wide {
    max-width: 560px;
    padding: 0 40px 36px;
    overflow: hidden;
}

/* Banner bleeds to the card's top and side edges; the negative bottom margin pulls the heading up over its faded
   (transparent) bottom edge. */
.sso-dra3-banner {
    display: block;
    width: calc(100% + 80px);
    max-width: none;
    height: auto;
    margin: 0 -40px -24px;
}

/* The banner's heading sits on the image's faded bottom edge. */
.sso-dra3-hero { position: relative; margin-bottom: 0; }
.sso-dra3-hero .sso-dra3-banner { margin-bottom: 0; }
/* 10% up from the bottom: inside the images' transparent bottom strip, as in the design. */
.sso-dra3-hero .sso-dra3-head { position: absolute; inset-inline: 0; bottom: 10%; margin: 0; }
.sso-dra3-hero .sso-dra3-head h1 { margin: 0; }

.sso-dra3-head,
.sso-body--dra3 .sso-page-header { position: relative; text-align: center; margin: 20px; }
.sso-dra3-head h1,
.sso-body--dra3 .sso-page-header h1 { font-size: 22px; margin: 0 0 6px; }
/* Back button at the header's start corner (prototype .back); the header keeps room for it. */
.sso-dra3-back {
    /* -20px cancels the header's margin, so the button lines up with the content's edge. */
    position: absolute; top: -4px; inset-inline-start: -20px; z-index: 1;
    width: 38px; height: 38px; display: grid; place-items: center; padding: 0;
    border-radius: 50%; border: 1px solid var(--sso-pill-border); background: var(--sso-pill-fill);
    color: var(--sso-text-soft); cursor: pointer; transition: color .18s, border-color .18s, background-color .18s;
}
.sso-dra3-back[hidden] { display: none; }
.sso-dra3-back:hover { color: var(--sso-accent); border-color: var(--sso-accent); background: rgba(249, 127, 23, .08); }
.sso-dra3-back:focus-visible { outline: 2px solid var(--sso-accent); outline-offset: 2px; }
.sso-body--dra3 .sso-page-header:has(.sso-dra3-back) { padding-inline: 28px; }
@media (max-width: 480px) {
    .sso-dra3-back { width: 34px; height: 34px; top: -2px; }
    .sso-body--dra3 .sso-page-header:has(.sso-dra3-back) { padding-inline: 20px; }
}
.sso-body--dra3 .sso-page-header p { margin: 0; color: var(--sso-text-soft); font-size: 15px; }

/* Buttons */
.sso-body--dra3 .sso-btn { min-height: 54px; }
.sso-body--dra3 .sso-btn:disabled {
    background: var(--sso-pill-fill);
    border-color: var(--sso-pill-border);
    color: var(--sso-text-muted);
    opacity: 1;
}

/* Social sign-in: stacked, full width. */
.sso-dra3-social { display: flex; flex-direction: column; gap: 12px; }
.sso-dra3-social .sso-btn { margin-top: 0; gap: 10px; }
.sso-dra3-social .sso-btn__icon { width: 26px; height: 26px; flex: none; }
/* Same label width on every button (fits the longest, "فيسبوك") so the icons line up vertically. */
.sso-dra3-social__label { width: 11em; text-align: start; }
/* Google's own button (popup sign-in, sso.js) in place of ours. Google fixes its size (40px high, at most 400px
   wide), so the Facebook and Apple buttons take the same size and the three read as one group. */
/* color-scheme: light matches Google's frame; with the page's dark scheme the browser paints the iframe opaque white. */
/* Google's iframe sits invisibly over our own Google button (same box), so only ours is seen. */
.sso-dra3-google-wrap { position: relative; width: 100%; max-width: 400px; }
.sso-dra3-google-wrap:hover > .sso-btn { border-color: var(--sso-accent); }
.sso-dra3-google { position: absolute; inset: 0; z-index: 1; display: flex; justify-content: center; overflow: hidden; opacity: .01; color-scheme: light; }
.sso-dra3-social--google { align-items: center; }
.sso-dra3-social--google .sso-btn { width: 100%; max-width: 400px; min-height: 40px; font-size: 14px; }
.sso-dra3-social--google .sso-btn__icon { width: 24px; height: 24px; }

/* Network sites */
.sso-body--dra3 .sso-network-sites { margin: 20px 0; }
.sso-body--dra3 .sso-network-sites__list { gap: 14px 24px; }
.sso-dra3-brand-word { color: var(--sso-accent); font-weight: 700; }

/* Collapsible panels: the Sarmady login and the registration. */
/* Same width and height as the social buttons above (400px, centred, 40px high). */
.sso-dra3-panel { max-width: 400px; margin: 12px auto 0; }
.sso-dra3-panel > summary { list-style: none; margin-top: 0; min-height: 40px; font-size: 14px; }
.sso-dra3-panel > summary::-webkit-details-marker { display: none; }
.sso-dra3-panel[open] > summary { border-color: var(--sso-accent); }
.sso-dra3-panel > form { padding-top: 16px; }
.sso-dra3-panel form .sso-btn { margin-top: 0; }
.sso-sarmady-logo.sso-dra3-panel__logo { width: 84px; margin: 0; flex: none; }

.sso-dra3-row-link { text-align: start; margin: -4px 0 16px; font-size: 14px; }
.sso-dra3-row-link a { color: var(--sso-accent); }

.sso-dra3-optional { margin-bottom: 16px; }
.sso-dra3-optional > summary { cursor: pointer; color: var(--sso-text-soft); font-size: 14px; margin-bottom: 12px; }

/* Fields: no icons, a little shorter than the SSO's. */
.sso-body--dra3 .sso-row { gap: 12px; }
.sso-body--dra3 .sso-field { margin-bottom: 16px; }
.sso-body--dra3 .sso-field label { margin-bottom: 6px; font-size: 15px; }
.sso-body--dra3 .sso-field input,
.sso-body--dra3 .sso-field select { height: 52px; font-size: 16px; }
/* LTR fields (email, phone, PSN ID): the Arabic placeholder reads right-to-left; the typed value stays LTR. */
.sso-body--dra3 .sso-field input[dir="ltr"] { text-align: right; } /* typed values sit on the right, as e-mail does */
.sso-body--dra3 .sso-field input[dir="ltr"]:placeholder-shown { direction: rtl; text-align: right; }
.sso-body--dra3 .sso-field input[aria-invalid="true"] { border-color: var(--signal); }
.sso-body--dra3 .sso-field-error:empty { display: none; }
/* Field errors: a soft tinted chip with an alert icon that slides in. */
.sso-body--dra3 .sso-field-error {
    display: flex; align-items: center; gap: 8px; width: fit-content; max-width: 100%;
    margin-top: 8px; padding: 6px 12px 6px 10px; border-radius: 10px;
    background: color-mix(in srgb, var(--signal) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--signal) 28%, transparent);
    font-size: 13px; font-weight: 600; line-height: 1.5;
    animation: sso-dra3-error-in .2s ease-out;
}
.sso-body--dra3 .sso-field-error::before {
    content: ""; flex: none; width: 16px; height: 16px; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 7v6M12 17h.01'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 7v6M12 17h.01'/%3E%3C/svg%3E") center / contain no-repeat;
}
.sso-body--dra3 .sso-field .input-validation-error { border-color: var(--signal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 18%, transparent); }
@keyframes sso-dra3-error-in { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .sso-body--dra3 .sso-field-error { animation: none; } }
.sso-body--dra3 .sso-field.sso-dra3-psn {
    padding: 16px;
    border: 1px solid transparent;
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(249, 127, 23, .12), rgba(249, 127, 23, 0) 60%) padding-box,
        linear-gradient(var(--sso-card-bg), var(--sso-card-bg)) padding-box,
        linear-gradient(135deg, var(--sso-accent), rgba(249, 127, 23, .15) 50%, var(--sso-accent)) border-box;
    box-shadow: 0 10px 30px -12px rgba(249, 127, 23, .45);
}
.sso-dra3-psn__head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.sso-dra3-psn__badge {
    display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 12px;
    background: linear-gradient(135deg, var(--sso-accent), #c85a00); color: #fff;
    box-shadow: 0 6px 16px -6px rgba(249, 127, 23, .7);
}
.sso-body--dra3 .sso-dra3-psn label { display: flex; align-items: center; gap: 8px; margin: 0 0 2px; font-size: 16px; font-weight: 800; letter-spacing: .02em; }
.sso-dra3-psn__req {
    padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0;
    color: var(--sso-accent); background: rgba(249, 127, 23, .12); border: 1px solid rgba(249, 127, 23, .35);
}
.sso-dra3-psn__note { margin: 0; font-size: 13px; font-weight: 600; color: var(--sso-accent); }
.sso-body--dra3 .sso-dra3-psn input { font-weight: 700; letter-spacing: .04em; border-color: rgba(249, 127, 23, .35); }
.sso-body--dra3 .sso-dra3-psn input:focus { border-color: var(--sso-accent); box-shadow: 0 0 0 3px rgba(249, 127, 23, .18); }
.sso-body--dra3 .sso-dra3-psn input:placeholder-shown { font-weight: 400; letter-spacing: 0; }
.sso-dra3-field-hint { display: block; color: var(--sso-text-muted); font-size: 13px; margin-top: 4px; }

/* Checkout (prototype step 2): signed-in account, the plan, entry details and confirmations. */
.sso-dra3-who {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 10px 14px; margin-bottom: 16px;
    border-radius: 8px; background: var(--sso-field-fill); border: 1px solid var(--sso-field-border);
    font-size: 14px; color: var(--sso-text-soft);
}
.sso-dra3-who form { margin: 0; flex: none; }
.sso-dra3-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 36px;
    border: 1px solid rgba(249, 127, 23, .4); background: rgba(249, 127, 23, .08); color: var(--sso-accent);
    font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
    transition: background-color .18s, border-color .18s;
}
.sso-dra3-chip:hover { background: rgba(249, 127, 23, .16); border-color: var(--sso-accent); }
.sso-dra3-chip:focus-visible { outline: 2px solid var(--sso-accent); outline-offset: 2px; }

.sso-body--dra3 .sso-plan {
    padding: 16px; margin-bottom: 20px;
    border-radius: 12px; border: 1px solid var(--sso-accent); background: rgba(249, 127, 23, .06);
}
.sso-body--dra3 .sso-plan__head { align-items: center; }
.sso-body--dra3 .sso-plan__price strong { white-space: nowrap; }
.sso-body--dra3 .sso-plan p { margin: 8px 0 0; color: var(--sso-text-soft); font-size: 14px; }

.sso-body--dra3 .sso-check { align-items: flex-start; gap: 10px; margin: 14px 0 0; font-size: 15px; cursor: pointer; }
.sso-body--dra3 .sso-check input { width: 20px; height: 20px; margin: 4px 0 0; flex: none; accent-color: var(--sso-accent); }
.sso-body--dra3 .sso-check + .sso-field-error { margin-inline-start: 30px; }
.sso-body--dra3 .sso-terms { margin: 0; }
.sso-body--dra3 .sso-terms__body { scrollbar-width: thin; scrollbar-color: var(--sso-accent) transparent; }

/* Pay button: amount, then the Paymob logo on a white pill (its blue needs a light background). */
.sso-dra3-pay-btn { gap: 14px; font-weight: 700; }
.sso-dra3-pay-btn__logo {
    flex: none; display: inline-flex; align-items: center;
    height: 34px; padding: 0 14px; border-radius: 999px; background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .12), inset 0 0 0 1px rgba(0, 0, 0, .04);
    transition: opacity .2s, filter .2s;
}
.sso-dra3-pay-btn__logo img { display: block; height: 16px; width: auto; }
.sso-dra3-pay-btn:disabled .sso-dra3-pay-btn__logo { opacity: .5; filter: grayscale(1); }
.sso-dra3-pay-hint { margin: 8px 0 0; text-align: center; font-size: 13px; color: var(--sso-text-muted); }

/* Mobile: the card fills the screen; the banner switches to its mobile crop (_Dra3Banner). */
@media (max-width: 599.98px) {
    .sso-body--dra3 .sso-main { padding: 0 0 24px; align-items: flex-start; }
    .sso-body--dra3 .sso-card,
    .sso-body--dra3 .sso-card.sso-wide { padding: 0 16px 28px; }
    .sso-dra3-banner { width: calc(100% + 32px); margin: 0 -16px -12%; }
    .sso-dra3-head h1,
    .sso-body--dra3 .sso-page-header h1 { font-size: 20px; }
    .sso-dra3-pay-btn { gap: 10px; }
    .sso-dra3-pay-btn__logo { height: 30px; padding: 0 10px; }
    .sso-dra3-pay-btn__logo img { height: 14px; }
}

/* Terms at checkout (prototype): a link-style button in the checkbox label opens the terms dialog (sso.js). */
.sso-dra3-link { padding: 0; border: 0; background: none; font: inherit; font-weight: 700; color: var(--sso-accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.sso-dra3-link:hover { text-decoration-thickness: 2px; }
.sso-dra3-link:focus-visible { outline: 2px solid var(--sso-accent); outline-offset: 2px; border-radius: 4px; }
.sso-dra3-dialog {
    width: min(800px, calc(100% - 32px)); max-height: calc(100vh - 64px); padding: 0 40px 32px;
    border-radius: 16px; border: 1px solid var(--sso-card-border); background: var(--sso-card-bg); color: var(--sso-text);
    scrollbar-width: thin; scrollbar-color: var(--sso-accent) transparent;
}
.sso-dra3-dialog::backdrop { background: rgba(0, 0, 0, .6); }
/* Title and close button (top left in RTL) stay visible while the terms scroll. */
.sso-dra3-dialog__head {
    position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin: 0 -40px 16px; padding: 24px 40px 12px; background: var(--sso-card-bg); border-bottom: 1px solid var(--sso-field-border);
}
.sso-dra3-dialog__head h2 { margin: 0; font-size: 20px; }
.sso-dra3-dialog__close {
    flex: none; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border-radius: 50%;
    border: 1px solid var(--sso-pill-border); background: var(--sso-pill-fill); color: var(--sso-text); cursor: pointer;
}
.sso-dra3-dialog__close:hover { border-color: var(--sso-accent); color: var(--sso-accent); }
.sso-dra3-dialog__close:focus-visible { outline: 2px solid var(--sso-accent); outline-offset: 2px; }
.sso-dra3-dialog__body { line-height: 1.8; }
/* Links in the terms, e.g. the complaints number opening WhatsApp (PlanTerms): styled like .sso-dra3-link. */
.sso-dra3-dialog__body a, .sso-body--dra3 .sso-terms__body a { color: var(--sso-accent); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.sso-dra3-dialog__body a:hover, .sso-body--dra3 .sso-terms__body a:hover { text-decoration-thickness: 2px; }
.sso-dra3-dialog__body a:focus-visible, .sso-body--dra3 .sso-terms__body a:focus-visible { outline: 2px solid var(--sso-accent); outline-offset: 2px; border-radius: 4px; }
.sso-dra3-dialog .sso-btn { display: flex; width: auto; min-width: 180px; margin-inline: auto; }
@media (max-width: 599.98px) {
    .sso-dra3-dialog { padding: 0 16px 24px; }
    .sso-dra3-dialog__head { margin: 0 -16px 16px; padding: 16px; }
    .sso-dra3-dialog .sso-btn { width: 100%; }
}
