/* ==========================================================
   Oukebdane Family — standalone public pages
   (invitation, suggest a correction) · Marble & Bordeaux
   ========================================================== */

:root {
    --bg:        #f2efe9;
    --surface:   #fffefb;
    --line:      rgba(124, 34, 51, 0.26);
    --line-soft: rgba(124, 34, 51, 0.13);
    --wine:      #7c2233;
    --wine-2:    #9c3546;
    --wine-deep: #5a1622;
    --ink:       #25211a;
    --muted:     #8c8271;
    --boy:       #33312c;
    --girl:      #bf7f8d;
    --danger:    #b5343f;
    --ok:        #3f7d54;
    --serif:   'Cormorant Garamond', 'Amiri', Georgia, serif;
    --display: 'Playfair Display', 'Amiri', Georgia, serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* The hidden attribute must always beat author display rules. */
[hidden] { display: none !important; }

body {
    background:
        radial-gradient(120% 80% at 10% 0%, rgba(255, 255, 255, 0.92), transparent 40%),
        radial-gradient(120% 90% at 90% 100%, rgba(214, 201, 178, 0.5), transparent 45%),
        linear-gradient(115deg, transparent 0 38%, rgba(124, 34, 51, 0.05) 38.4% 39%, transparent 39.4%),
        var(--bg);
    background-attachment: fixed;
    color: var(--ink);
    font-family: var(--serif);
    font-size: 17px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

[dir="rtl"] body { font-family: 'Amiri', var(--serif); }

/* ----------------------------------------------------------
   Header / footer
   ---------------------------------------------------------- */
.page-hero { text-align: center; padding: 2.4rem 1.2rem 0.6rem; position: relative; }

.lang-switch {
    position: absolute;
    top: 0.9rem;
    inset-inline-end: 1.1rem;
    display: flex;
    gap: 0.35rem;
}

.lang-switch a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    padding: 0.3rem 0.58rem;
    border: 1px solid transparent;
    border-radius: 999px;
    transition: all 0.25s ease;
    font-family: var(--display);
}

.lang-switch a:hover { color: var(--wine); }

.lang-switch a.active {
    color: var(--wine);
    border-color: var(--line);
    background: rgba(124, 34, 51, 0.08);
}

.page-brand { text-decoration: none; display: inline-block; }

.page-kicker {
    display: block;
    font-size: 0.72rem;
    letter-spacing: 0.45em;
    text-indent: 0.45em;
    text-transform: uppercase;
    color: var(--wine);
}

[dir="rtl"] .page-kicker { letter-spacing: 0.2em; text-indent: 0.2em; }

.page-name {
    display: block;
    font-family: var(--display);
    font-weight: 600;
    font-size: clamp(1.9rem, 5vw, 2.8rem);
    letter-spacing: 0.08em;
    margin-top: 0.2rem;
    background: linear-gradient(180deg, var(--wine-2), var(--wine) 58%, var(--wine-deep));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-orn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    max-width: 380px;
    margin: 0.9rem auto 0;
}

.page-orn span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line)); }
.page-orn span:last-child { background: linear-gradient(90deg, var(--line), transparent); }
.page-orn i { width: 7px; height: 7px; background: var(--wine); transform: rotate(45deg); }

.page-main {
    flex: 1;
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    padding: 1.4rem 1.2rem 2rem;
}

.page-footer { text-align: center; padding: 1.2rem 1.2rem 2rem; }

.back-link { color: var(--wine); text-decoration: none; font-size: 0.95rem; }
.back-link:hover { text-decoration: underline; }

.page-credit { color: var(--muted); font-size: 0.85rem; margin-top: 0.6rem; }
.page-credit strong { font-family: var(--display); font-weight: 600; color: var(--wine); }
.page-credit a { color: var(--wine); font-weight: 600; text-decoration: none; }
.page-credit a:hover { text-decoration: underline; }
.page-credit-secondary { margin-top: 0.25rem; font-size: 0.82rem; }

/* ----------------------------------------------------------
   Panel
   ---------------------------------------------------------- */
.panel {
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: 18px;
    padding: 1.8rem 1.7rem;
    box-shadow: 0 18px 50px rgba(90, 22, 34, 0.10);
    position: relative;
}

.panel::before {
    content: '';
    position: absolute;
    inset: 7px;
    border: 1px solid rgba(124, 34, 51, 0.10);
    border-radius: 12px;
    pointer-events: none;
}

.panel-center { text-align: center; }

.panel-icon {
    width: 62px;
    height: 62px;
    margin: 0 auto 0.9rem;
    border-radius: 50%;
    border: 2px solid var(--wine);
    color: var(--wine);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
}

.panel h1 {
    font-family: var(--display);
    font-weight: 600;
    font-size: 1.6rem;
    color: var(--wine);
    margin-bottom: 0.5rem;
}

.panel h2 {
    font-family: var(--display);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--wine);
    margin: 1.4rem 0 0.7rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line-soft);
}

.lead { color: var(--ink); line-height: 1.55; }

.reason {
    margin-top: 0.7rem;
    color: var(--muted);
    font-style: italic;
}

.one-time {
    margin-top: 0.9rem;
    font-size: 0.85rem;
    color: var(--muted);
    font-style: italic;
}

.summary { margin: 1.1rem 0 0.3rem; display: grid; gap: 0.4rem; }

.summary div { display: flex; gap: 0.7rem; align-items: baseline; flex-wrap: wrap; }

.summary dt {
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--wine);
    min-width: 130px;
}

[dir="rtl"] .summary dt { letter-spacing: 0; }

.summary dd { font-family: var(--display); font-size: 1.05rem; }

.invite-message {
    margin-top: 1rem;
    padding: 0.9rem 1.1rem;
    background: rgba(124, 34, 51, 0.05);
    border-inline-start: 3px solid var(--wine);
    border-radius: 0 10px 10px 0;
    line-height: 1.55;
}

[dir="rtl"] .invite-message { border-radius: 10px 0 0 10px; }

.quote-label {
    display: block;
    font-size: 0.66rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--wine);
    margin-bottom: 0.3rem;
}

/* ----------------------------------------------------------
   Buttons
   ---------------------------------------------------------- */
.btn-primary, .btn-danger {
    display: inline-block;
    border: none;
    border-radius: 999px;
    padding: 0.68rem 1.5rem;
    font-family: var(--display);
    font-size: 0.98rem;
    letter-spacing: 0.03em;
    cursor: pointer;
    text-decoration: none;
    color: #fff;
    transition: all 0.2s ease;
}

.btn-primary { background: linear-gradient(160deg, var(--wine-2), var(--wine) 60%, var(--wine-deep)); }
.btn-primary:hover { box-shadow: 0 8px 20px rgba(124, 34, 51, 0.3); transform: translateY(-1px); }

.btn-danger { background: var(--danger); }
.btn-danger:hover { box-shadow: 0 8px 20px rgba(181, 52, 63, 0.3); }

.ghost-btn {
    display: inline-block;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--wine);
    border-radius: 999px;
    padding: 0.58rem 1.2rem;
    font-family: var(--serif);
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.ghost-btn:hover { background: rgba(124, 34, 51, 0.08); }
.ghost-btn.danger { color: var(--danger); border-color: rgba(181, 52, 63, 0.4); }
.ghost-btn.danger:hover { background: rgba(181, 52, 63, 0.09); }

.choice-row {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-top: 1.4rem;
    align-items: center;
}

/* ----------------------------------------------------------
   Forms
   ---------------------------------------------------------- */
.decline-form { margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line-soft); }
.decline-form h2 { margin-top: 0; padding-top: 0; border: none; }

.member-form { margin-top: 1.4rem; }

/* ----------------------------------------------------------
   Step-by-step wizard
   ---------------------------------------------------------- */
.wiz-progress {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 1.4rem;
    counter-reset: step;
}

.wiz-dot {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    background: none;
    border: none;
    padding: 0;
    cursor: default;
    font-family: var(--serif);
    color: var(--muted);
    position: relative;
}

.wiz-dot i {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-style: normal;
    font-size: 0.9rem;
    font-family: var(--display);
    transition: all 0.25s ease;
    position: relative;
    z-index: 2;
}

.wiz-dot em {
    font-style: normal;
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    text-align: center;
    line-height: 1.25;
    opacity: 0.85;
}

/* connecting rail */
.wiz-dot::before {
    content: '';
    position: absolute;
    top: 15px;
    inset-inline-start: -50%;
    width: 100%;
    height: 1px;
    background: var(--line-soft);
    z-index: 1;
}

.wiz-dot:first-child::before { display: none; }

.wiz-dot.active i {
    border-color: var(--wine);
    background: var(--wine);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(124, 34, 51, 0.12);
}

.wiz-dot.active { color: var(--wine); }

.wiz-dot.done i {
    border-color: var(--wine);
    color: var(--wine);
    background: rgba(124, 34, 51, 0.08);
}

.wiz-dot.done { cursor: pointer; }
.wiz-dot.done:hover i { background: rgba(124, 34, 51, 0.16); }

.wiz-step { animation: wiz-in 0.28s ease; }

@keyframes wiz-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

.wiz-heading {
    font-family: var(--display);
    font-weight: 600;
    font-size: 1.18rem;
    color: var(--wine);
    margin: 0 0 0.2rem;
    padding: 0;
    border: none;
}

.wiz-sub {
    color: var(--muted);
    font-size: 0.92rem;
    margin-bottom: 1.1rem;
    line-height: 1.5;
}

/* Direction-aware arrows: they point the way the language reads. */
.wiz-next::after  { content: ' →'; }
.wiz-prev::before { content: '← '; }
[dir="rtl"] .wiz-next::after  { content: ' ←'; }
[dir="rtl"] .wiz-prev::before { content: '→ '; }

@media (max-width: 560px) {
    .wiz-dot em { display: none; }
    .wiz-progress { gap: 0.5rem; margin-bottom: 1.2rem; }
    .wiz-dot i { width: 34px; height: 34px; font-size: 0.95rem; }
    .wiz-dot::before { top: 17px; }
}

label { display: block; margin-bottom: 0.9rem; }

label > span {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.3rem;
}

label > span em { font-style: normal; text-transform: none; letter-spacing: 0; opacity: 0.75; }
label > span em.req { color: var(--danger); }

input[type="text"], input[type="url"], input[type="date"], textarea {
    width: 100%;
    background: #fff;
    border: 1px solid var(--line-soft);
    border-radius: 9px;
    color: var(--ink);
    font-family: var(--serif);
    font-size: 1rem;
    padding: 0.65rem 0.8rem;
    transition: border-color 0.2s ease;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--wine);
    box-shadow: 0 0 0 3px rgba(124, 34, 51, 0.1);
}

textarea { resize: vertical; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

.check-line { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.check-line span { margin: 0; text-transform: none; letter-spacing: 0; font-size: 0.98rem; color: var(--ink); }
.check-line input { accent-color: var(--wine); width: 16px; height: 16px; }

.gender-choice {
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    padding: 0.7rem 0.9rem 0.85rem;
    margin-bottom: 0.9rem;
    display: flex;
    gap: 0.7rem;
}

.gender-choice legend {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0 0.3rem;
}

.gender-choice label {
    flex: 1;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border: 1px solid var(--line-soft);
    border-radius: 9px;
    padding: 0.55rem;
    cursor: pointer;
}

.gender-choice input { accent-color: var(--wine); }
.gender-choice label span { margin: 0; text-transform: none; letter-spacing: 0; font-size: 1rem; color: var(--ink); }
.gender-choice label:has(input:checked).radio-boy  { border-color: var(--boy);  background: rgba(51, 49, 44, 0.07); }
.gender-choice label:has(input:checked).radio-girl { border-color: var(--girl); background: rgba(191, 127, 141, 0.12); }

.hint { font-size: 0.84rem; color: var(--muted); margin-top: 0.3rem; }

.photo-field { display: flex; gap: 1.1rem; align-items: center; flex-wrap: wrap; }

.photo-preview {
    width: 104px;
    height: 104px;
    border-radius: 50%;
    overflow: hidden;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f6f2ea;
    border: 2px solid var(--line);
}

.photo-preview.male   { border-color: var(--boy); }
.photo-preview.female { border-color: var(--girl); }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-placeholder { color: var(--muted); font-size: 1.2rem; }

.form-foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.7rem;
    margin-top: 1.5rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--line-soft);
    flex-wrap: wrap;
}

/* ----------------------------------------------------------
   Alerts
   ---------------------------------------------------------- */
.alert {
    border-radius: 10px;
    padding: 0.8rem 1rem;
    margin-top: 1.1rem;
    font-size: 0.95rem;
}

.alert-error { background: rgba(181, 52, 63, 0.09); border: 1px solid rgba(181, 52, 63, 0.35); color: var(--danger); }

/* ----------------------------------------------------------
   Crop modal
   ---------------------------------------------------------- */
.crop-modal {
    position: fixed;
    inset: 0;
    background: rgba(37, 33, 26, 0.55);
    backdrop-filter: blur(5px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.crop-dialog {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1.3rem;
    width: min(560px, 100%);
    box-shadow: 0 30px 80px rgba(90, 22, 34, 0.3);
}

.crop-dialog h3 { font-family: var(--display); font-weight: 600; font-size: 1.2rem; color: var(--wine); }

.crop-stage { height: 320px; background: #f6f2ea; border-radius: 10px; overflow: hidden; margin-top: 0.8rem; }
.crop-stage img { max-width: 100%; display: block; }

.cropper-view-box { outline: 2px solid var(--wine); border-radius: 50%; }
.cropper-face { border-radius: 50%; }
.cropper-line, .cropper-point { background-color: var(--wine); }

.crop-tools { display: flex; gap: 0.5rem; margin-top: 0.9rem; flex-wrap: wrap; }

.crop-foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.7rem;
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--line-soft);
}
