/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Public Form Page — "Manuscript" Design
   namespace: fm
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* ── Hero Banner (contact-page style) ──────────────────── */
.fm-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #17693b 0%, #0f4a29 100%);
    padding: calc(var(--site-header-height, 72px) + var(--site-notices-height, 0px) + 48px) 6vw 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fm-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.18;
    pointer-events: none;
}

.fm-hero-jaali {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.24;
    z-index: 0;
    -webkit-mask-image: radial-gradient(ellipse 75% 100% at 20% 30%, black 30%, transparent 85%);
    mask-image: radial-gradient(ellipse 75% 100% at 20% 30%, black 30%, transparent 85%);
}
.fm-hero-jaali svg {
    width: 100%;
    height: 100%;
}
.fm-hero-jaali path.tl {
    fill: none;
    stroke: #C9A44C;
    stroke-width: 0.75;
    stroke-dasharray: 2600;
    stroke-dashoffset: 2600;
    animation: fm-draw-lattice 3.2s cubic-bezier(.4,0,.2,1) forwards;
}
.fm-hero-jaali circle.td {
    fill: #C9A44C;
    opacity: 0;
    animation: fm-dot-fade 1s ease forwards;
    animation-delay: 2.8s;
}
@keyframes fm-dot-fade    { to { opacity: 0.35; } }
@keyframes fm-draw-lattice { to { stroke-dashoffset: 0; } }

.fm-hero-inner {
    position: relative;
    z-index: 2;
    max-width: 800px;
    text-align: center;
}

.fade-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fm-fadeUp 0.85s cubic-bezier(.16,1,.3,1) forwards;
}
@keyframes fm-fadeUp {
    to { opacity: 1; transform: translateY(0); }
}

/* Eyebrow pill */
.fm-eyebrow-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 9px 22px 9px 14px;
    border: 1px solid rgba(201,164,76,0.22);
    border-radius: 100px;
    background: linear-gradient(180deg, rgba(201,164,76,0.09), rgba(201,164,76,0.02));
    color: #FFE599;
    font-family: 'Poppins', -apple-system, sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 22px;
}
.fm-eyebrow-pill svg {
    width: 14px;
    height: 14px;
    color: #C9A44C;
}

/* Title */
.fm-hero-title {
    font-family: 'Amiri', 'Georgia', serif;
    font-weight: 700;
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    line-height: 1.1;
    color: #ffffff !important;
    margin: 0 0 18px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.18);
}

/* Description */
.fm-hero-desc {
    font-family: 'Amiri', serif;
    font-size: clamp(15px, 2vw, 18px);
    line-height: 1.7;
    color: rgba(255,255,255,0.75);
    max-width: 56ch;
    margin: 0 auto 22px;
}

/* Breadcrumb trail */
.fm-hero-crumb {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    font-family: 'Poppins', -apple-system, sans-serif;
    font-size: 14px;
}
.fm-hero-crumb a {
    color: rgba(255,255,255,0.72);
    text-decoration: none;
    transition: color .3s ease;
}
.fm-hero-crumb a:hover {
    color: #ffffff;
}
.fm-crumb-sep {
    color: rgba(255,255,255,0.4);
    font-size: 10px;
    line-height: 1;
}
.fm-crumb-current {
    color: #FFE599;
    font-weight: 500;
}

/* ── Page shell ────────────────────────────────────────── */
.fm-page {
    position: relative;
    padding: clamp(3rem, 6vw, 5rem) 0 clamp(4rem, 8vw, 7rem);
    min-height: 50vh;
    background: linear-gradient(180deg, #EDE8D5 0%, #F4EEDD 40%, #FBF7EC 100%);
    overflow: hidden;
    isolation: isolate;
}

/* Girih watermark */
.fm-page::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.035;
    pointer-events: none;
    z-index: 0;
    background-image:
        repeating-linear-gradient(60deg, #0B4A45 0px, #0B4A45 1px, transparent 1px, transparent 60px),
        repeating-linear-gradient(-60deg, #0B4A45 0px, #0B4A45 1px, transparent 1px, transparent 60px),
        repeating-linear-gradient(0deg, #0B4A45 0px, #0B4A45 1px, transparent 1px, transparent 60px);
}

/* Hero accent line */
.fm-hero-line {
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, #C9A44C, #00ff88);
    margin: 24px auto 0;
    border-radius: 2px;
}

/* ── Form Container ────────────────────────────────────── */
.fm-container {
    position: relative;
    z-index: 1;
    max-width: 880px;
    margin: -40px auto 0;
    padding: 0 clamp(1rem, 3vw, 2rem);
}

/* ── Card ──────────────────────────────────────────────── */
.fm-card {
    position: relative;
    background: #fff;
    border: 1px solid rgba(173,138,64,0.15);
    border-radius: 6px;
    box-shadow:
        0 4px 24px rgba(20,30,28,0.06),
        0 20px 60px rgba(20,30,28,0.08);
    overflow: hidden;
}

/* Card top bar */
.fm-card-bar {
    height: 5px;
    background: linear-gradient(90deg, #17693b, #C9A44C, #17693b);
}

/* Card inner */
.fm-card-inner {
    padding: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 4vw, 2.8rem);
}

/* ── Card Header ───────────────────────────────────────── */
.fm-card-header {
    text-align: center;
    margin-bottom: 2rem;
}

/* Eyebrow */
.fm-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 999px;
    background: rgba(23,105,59,0.06);
    border: 1px solid rgba(23,105,59,0.15);
    margin-bottom: 16px;
}
.fm-eyebrow svg {
    width: 14px; height: 14px;
    color: #17693b;
}
.fm-eyebrow span {
    font-family: 'Cairo', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #17693b;
}

/* Title */
.fm-title {
    font-family: 'Cairo', sans-serif;
    font-weight: 800;
    font-size: clamp(1.4rem, 3vw, 2rem);
    line-height: 1.2;
    color: #1a2332;
    margin: 0 0 12px;
}

/* Description */
.fm-desc {
    font-family: 'Amiri', serif;
    font-style: italic;
    font-size: 15px;
    line-height: 1.75;
    color: #5a6577;
    max-width: 50ch;
    margin: 0 auto;
}

/* Related link */
.fm-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 8px 18px;
    border: 1.5px solid rgba(193,85,48,0.3);
    border-radius: 999px;
    color: #C15530;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    font-size: 12px;
    text-decoration: none;
    transition: all 0.25s;
}
.fm-link:hover {
    background: rgba(193,85,48,0.06);
    border-color: #C15530;
    transform: translateY(-1px);
}

/* ── Divider ───────────────────────────────────────────── */
.fm-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 2rem;
}
.fm-divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(173,138,64,0.3), transparent);
}
.fm-divider svg {
    width: 16px; height: 16px;
    color: #C9A44C;
    flex-shrink: 0;
}

/* ── Form Grid ─────────────────────────────────────────── */
.fm-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px 20px;
}

/* Full-width fields */
.fm-field--full,
.fm-form > .fm-alert,
.fm-form > .fm-submit-wrap,
.fm-form > .fm-otp-wrap {
    grid-column: 1 / -1;
}

/* ── Field ─────────────────────────────────────────────── */
.fm-field {
    margin: 0;
}

.fm-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.04em;
    color: #2d3a4a;
    margin-bottom: 7px;
}
.fm-label .req {
    color: #C15530;
    font-weight: 800;
}

/* Inputs */
.fm-input,
.fm-textarea,
.fm-select {
    width: 100%;
    background: #f7f5ef;
    border: 1.5px solid rgba(173,138,64,0.2);
    border-radius: 8px;
    padding: 12px 14px;
    font-family: 'Amiri', serif;
    font-size: 15px;
    color: #1a2332;
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.fm-input::placeholder,
.fm-textarea::placeholder {
    color: rgba(26,35,50,0.3);
}
.fm-input:focus,
.fm-textarea:focus,
.fm-select:focus {
    border-color: #17693b;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(23,105,59,0.1);
}
.fm-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Help text */
.fm-help {
    font-size: 11.5px;
    color: #7a8599;
    margin-top: 5px;
    line-height: 1.5;
}

/* ── Radio / Checkbox ──────────────────────────────────── */
.fm-check-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fm-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border: 1.5px solid rgba(173,138,64,0.2);
    border-radius: 8px;
    background: #f7f5ef;
    transition: all 0.2s;
    cursor: pointer;
}
.fm-check:hover {
    border-color: #17693b;
    background: #f0ede4;
}
.fm-check input {
    accent-color: #17693b;
    width: 16px; height: 16px;
}
.fm-check label {
    font-family: 'Amiri', serif;
    font-size: 15px;
    color: #1a2332;
    margin: 0;
    cursor: pointer;
}

/* ── OTP Block ─────────────────────────────────────────── */
.fm-otp {
    background: linear-gradient(135deg, rgba(23,105,59,0.04), rgba(201,164,76,0.04));
    border: 1.5px solid rgba(23,105,59,0.15);
    border-radius: 10px;
    padding: 18px 20px;
}
.fm-otp-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.fm-otp-header i {
    color: #25D366;
    font-size: 18px;
}
.fm-otp-header span {
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 13px;
    color: #17693b;
}
.fm-otp-status {
    font-size: 12.5px;
    color: #5a6577;
    margin: 0 0 12px;
    line-height: 1.5;
}
.fm-otp-status.verified {
    color: #17693b;
    font-weight: 700;
}
.fm-otp-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.fm-otp-input {
    width: 130px;
    min-height: 42px;
    border-radius: 8px;
    border: 1.5px solid rgba(173,138,64,0.2);
    background: #fff;
    color: #1a2332;
    font-size: 16px;
    letter-spacing: 4px;
    text-align: center;
    font-family: 'Cairo', monospace;
    font-weight: 700;
    padding: 0 12px;
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
}
.fm-otp-input:focus {
    border-color: #17693b;
    box-shadow: 0 0 0 3px rgba(23,105,59,0.1);
}
.fm-otp-btn {
    padding: 10px 18px;
    border-radius: 8px;
    border: 1.5px solid #17693b;
    background: transparent;
    color: #17693b;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.fm-otp-btn:hover {
    background: rgba(23,105,59,0.06);
}
.fm-otp-btn--verify {
    background: #17693b;
    color: #fff;
    border-color: #17693b;
}
.fm-otp-btn--verify:hover {
    background: #0E5C41;
    box-shadow: 0 4px 12px rgba(23,105,59,0.25);
}

/* ── Submit Button ─────────────────────────────────────── */
.fm-submit-wrap {
    margin-top: 8px;
}
.fm-submit {
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #17693b 0%, #0E5C41 100%);
    color: #fff;
    font-family: 'Cairo', sans-serif;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 0.04em;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s, box-shadow 0.25s;
    box-shadow: 0 4px 16px rgba(23,105,59,0.25);
}
.fm-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(23,105,59,0.35);
}
.fm-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.fm-submit .fm-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,0.25) 50%, transparent 70%);
    transform: translateX(-100%);
}
.fm-submit:hover:not(:disabled) .fm-shimmer {
    animation: fmShimmer 1s ease;
}
@keyframes fmShimmer {
    to { transform: translateX(100%); }
}

/* ── Alerts ────────────────────────────────────────────── */
.fm-alert {
    padding: 14px 18px;
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-size: 13.5px;
    font-weight: 600;
}
.fm-alert--danger {
    background: rgba(193,85,48,0.06);
    border: 1.5px solid rgba(193,85,48,0.2);
    color: #C15530;
}

/* ── Success State ─────────────────────────────────────── */
.fm-success {
    text-align: center;
    padding: 3.5rem 2rem;
}
.fm-success-icon {
    width: 72px; height: 72px;
    margin: 0 auto 24px;
    color: #17693b;
    animation: fmSuccessPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes fmSuccessPop {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.fm-success h2 {
    font-family: 'Cairo', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    color: #1a2332;
    margin: 0 0 10px;
}
.fm-success p {
    font-family: 'Amiri', serif;
    font-style: italic;
    font-size: 16px;
    color: #5a6577;
    line-height: 1.7;
    margin: 0;
    max-width: 40ch;
    margin-left: auto;
    margin-right: auto;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 767px) {
    .fm-form { grid-template-columns: 1fr; }
    .fm-hero { padding: calc(var(--site-header-height, 72px) + 32px) 24px 40px; }
    .fm-hero-title { font-size: 1.8rem; }
    .fm-container { margin-top: -24px; }
}

@media (prefers-reduced-motion: reduce) {
    .fade-up,
    path.tl {
        animation: none !important;
        opacity: 1 !important;
        stroke-dashoffset: 0 !important;
        transform: none !important;
    }
}
