/* ============================================================
   Blue Ocean Café — Membership Network
   Ocean + Coffee theme · RTL · glassmorphism · motion
   ============================================================ */

:root {
    --ocean-900: #061a30;
    --ocean-800: #0a2540;
    --ocean-700: #0e3a5f;
    --ocean-600: #145c8e;
    --ocean-500: #1f7fb8;
    --ocean-400: #3aa8df;
    --ocean-300: #7cc8ee;
    --coffee-700: #5a3621;
    --coffee-500: #8a5a36;
    --coffee-400: #b07b4c;
    --coffee-300: #d6a374;

    --ink: #0a2540;
    --muted: #5b7186;
    --line: #e2e9f1;
    --bg: #eef4fb;
    --card: rgba(255, 255, 255, 0.82);
    --card-solid: #ffffff;

    --radius: 20px;
    --radius-sm: 12px;
    --shadow-sm: 0 4px 16px rgba(10, 37, 64, 0.06);
    --shadow: 0 18px 50px rgba(10, 37, 64, 0.12);
    --shadow-lg: 0 30px 80px rgba(10, 37, 64, 0.18);

    --grad-ocean: linear-gradient(135deg, #145c8e 0%, #1f7fb8 45%, #3aa8df 100%);
    --grad-deep: linear-gradient(160deg, #061a30 0%, #0a2540 55%, #0e3a5f 100%);
    --grad-coffee: linear-gradient(135deg, #8a5a36, #b07b4c);

    --font: "Vazirmatn", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.8;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--ocean-600); text-decoration: none; }
a:hover { color: var(--ocean-500); }

/* ---------- Animated ocean background ---------- */
.bg-ocean {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: var(--grad-deep);
    overflow: hidden;
}
.bg-ocean::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(1200px 600px at 80% -10%, rgba(58, 168, 223, 0.35), transparent 60%),
        radial-gradient(900px 500px at 10% 110%, rgba(176, 123, 76, 0.28), transparent 55%);
}
.page-form .bg-ocean, .page-admin .bg-ocean {
    background: linear-gradient(180deg, #dbeafc 0%, #eef4fb 40%, #eef4fb 100%);
}
.page-form .bg-ocean::after, .page-admin .bg-ocean::after {
    background:
        radial-gradient(1000px 500px at 85% -5%, rgba(58, 168, 223, 0.18), transparent 60%),
        radial-gradient(800px 480px at 5% 5%, rgba(176, 123, 76, 0.12), transparent 55%);
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.5), rgba(124,200,238,0.12));
    filter: blur(2px);
    animation: float 18s ease-in-out infinite;
    opacity: .5;
}
.b1 { width: 220px; height: 220px; top: 12%; right: -40px; animation-delay: 0s; }
.b2 { width: 140px; height: 140px; top: 60%; right: 12%; animation-delay: -4s; }
.b3 { width: 300px; height: 300px; bottom: -60px; left: -60px; animation-delay: -8s; }
.b4 { width: 90px; height: 90px; top: 30%; left: 18%; animation-delay: -12s; }

@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0) scale(1); }
    50% { transform: translateY(-40px) translateX(20px) scale(1.08); }
}

.wave-layer {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 180px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 180'%3E%3Cpath fill='%231f7fb8' fill-opacity='0.18' d='M0,96L48,112C96,128,192,160,288,154.7C384,149,480,107,576,96C672,85,768,107,864,117.3C960,128,1056,128,1152,112C1248,96,1344,64,1392,48L1440,32L1440,180L0,180Z'/%3E%3C/svg%3E") repeat-x bottom / 1440px 180px;
    animation: wave 16s linear infinite;
    opacity: .6;
}
@keyframes wave { from { background-position-x: 0; } to { background-position-x: 1440px; } }

/* ---------- Layout ---------- */
.container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 48px 20px 64px;
}
.center-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Hero ---------- */
.hero { text-align: center; margin-bottom: 36px; color: #fff; }
.page-form .hero, .page-admin .hero { color: var(--ink); }
.hero-logo {
    width: 132px; height: 132px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: var(--shadow), 0 0 0 8px rgba(255,255,255,0.5);
    display: grid; place-items: center;
    overflow: hidden;
    animation: pop .8s cubic-bezier(.2,.9,.3,1.4) both;
}
.hero-logo img { width: 88%; height: 88%; object-fit: contain; }
.hero-title {
    font-size: clamp(1.7rem, 4vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -.5px;
    background: var(--grad-ocean);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-subtitle { color: var(--muted); font-size: 1.05rem; margin-top: 10px; }
.hero-badges { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 20px; }
.badge {
    background: rgba(31,127,184,0.10);
    color: var(--ocean-600);
    border: 1px solid rgba(31,127,184,0.22);
    padding: 7px 14px; border-radius: 999px; font-size: .86rem; font-weight: 600;
    backdrop-filter: blur(6px);
}

@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- Card ---------- */
.card {
    background: var(--card);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px;
}
.form-card { position: relative; overflow: hidden; }

/* progress rail */
.progress-rail {
    position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: rgba(31,127,184,0.12);
}
.progress-fill {
    height: 100%; width: 0;
    background: var(--grad-ocean);
    transition: width .25s ease;
}

/* ---------- Form sections ---------- */
.form-section { padding: 26px 0; border-bottom: 1px dashed var(--line); }
.form-section:last-of-type { border-bottom: none; }
.section-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.section-index {
    flex: 0 0 auto;
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border-radius: 12px;
    background: var(--grad-ocean);
    color: #fff; font-weight: 800; font-size: 1.1rem;
    box-shadow: 0 8px 20px rgba(31,127,184,0.35);
}
.section-head h2 { font-size: 1.2rem; font-weight: 800; color: var(--ocean-800); }
.section-head p { font-size: .9rem; color: var(--muted); }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* ---------- Fields ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field-full { grid-column: 1 / -1; }
.field label { font-size: .92rem; font-weight: 700; color: var(--ocean-800); }
.field .req { color: #e2574c; margin-inline-start: 2px; }

input[type="text"], input[type="email"], input[type="password"],
input[type="search"], input[type="tel"], textarea {
    width: 100%;
    font-family: var(--font);
    font-size: .98rem;
    color: var(--ink);
    background: rgba(255,255,255,0.9);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 13px 15px;
    transition: border-color .2s, box-shadow .2s, transform .2s;
}
input::placeholder, textarea::placeholder { color: #9fb1c2; }
input:focus, textarea:focus {
    outline: none;
    border-color: var(--ocean-400);
    box-shadow: 0 0 0 4px rgba(58,168,223,0.16);
}
textarea { resize: vertical; min-height: 90px; }
.field.has-error input, .field.has-error textarea { border-color: #e2574c; }

.field-help { font-size: .8rem; color: var(--muted); }
.field-error { font-size: .82rem; color: #e2574c; font-weight: 600; }

/* ---------- Collaboration chips ---------- */
.chip-group { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.chip {
    display: flex; align-items: center; gap: 10px;
    padding: 13px 16px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.7);
    cursor: pointer;
    transition: all .2s;
    font-weight: 600; font-size: .92rem;
    user-select: none;
}
.chip:hover { border-color: var(--ocean-300); transform: translateY(-2px); }
.chip input { width: 19px; height: 19px; accent-color: var(--ocean-500); cursor: pointer; }
.chip:has(input:checked) {
    border-color: var(--ocean-500);
    background: rgba(31,127,184,0.10);
    color: var(--ocean-700);
    box-shadow: 0 6px 16px rgba(31,127,184,0.18);
}
.other-field { margin-top: 16px; }

/* ---------- Dropzone ---------- */
.dropzone {
    display: block;
    position: relative;
    border: 2px dashed var(--ocean-300);
    border-radius: var(--radius);
    background: rgba(31,127,184,0.05);
    padding: 24px;
    cursor: pointer;
    transition: all .25s;
}
.dropzone:hover, .dropzone.dragover {
    border-color: var(--ocean-500);
    background: rgba(31,127,184,0.10);
    transform: translateY(-2px);
}
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 1; }
.dropzone-layout {
    display: flex;
    align-items: center;
    gap: 20px;
    pointer-events: none;
}
.dz-thumb {
    flex: 0 0 auto;
    width: 88px;
    height: 88px;
    border-radius: 14px;
    background: #fff;
    border: 1.5px solid var(--line);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: grid;
    place-items: center;
}
.dz-thumb-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    height: 100%;
    color: var(--ocean-400);
    padding: 8px;
    text-align: center;
}
.dz-thumb-empty span {
    font-size: .68rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--muted);
}
.dz-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}
.dropzone-inner { flex: 1; color: var(--ocean-600); text-align: right; }
.dz-title { font-weight: 700; margin-top: 6px; }
.dz-hint { font-size: .82rem; color: var(--muted); }
.dz-name { font-size: .85rem; font-weight: 600; color: var(--ocean-700); margin-top: 6px; }

/* ---------- Consent ---------- */
.consent {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 16px 18px;
    background: rgba(31,127,184,0.06);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: all .2s;
}
.consent:hover { border-color: var(--ocean-300); }
.consent.has-error { border-color: #e2574c; }
.consent input { width: 22px; height: 22px; accent-color: var(--ocean-500); margin-top: 2px; cursor: pointer; flex: 0 0 auto; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: var(--font); font-weight: 700; font-size: .98rem;
    border: none; border-radius: 999px; padding: 13px 26px;
    cursor: pointer; transition: transform .2s, box-shadow .2s, filter .2s;
    text-decoration: none;
}
.btn svg { transition: transform .2s; }
.btn-primary {
    background: var(--grad-ocean); color: #fff;
    box-shadow: 0 14px 30px rgba(31,127,184,0.4);
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.05); color: #fff; }
.btn-primary:hover svg { transform: translateX(-4px); }
.btn-primary:active { transform: translateY(0); }
.btn-block { width: 100%; }
.btn-ghost {
    background: rgba(255,255,255,0.7); color: var(--ocean-700);
    border: 1.5px solid var(--line);
}
.btn-ghost:hover { border-color: var(--ocean-300); color: var(--ocean-700); transform: translateY(-2px); }
.btn-sm { padding: 8px 16px; font-size: .85rem; }
.btn-danger { background: #fdecec; color: #d8483c; border: 1.5px solid #f6cfcb; }
.btn-danger:hover { background: #d8483c; color: #fff; }

.form-actions {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; margin-top: 28px; flex-wrap: wrap;
}
.link-muted { color: var(--muted); font-size: .9rem; font-weight: 600; }
.link-muted:hover { color: var(--ocean-500); }

/* ---------- Alerts ---------- */
.alert {
    padding: 14px 18px; border-radius: var(--radius-sm);
    margin-bottom: 18px; font-weight: 600; font-size: .92rem;
    animation: slideDown .4s ease both;
}
.alert-error { background: #fdecec; color: #c23b30; border: 1px solid #f6cfcb; }
.alert-success { background: #e7f7ee; color: #1f8a52; border: 1px solid #bce6cd; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Footer ---------- */
.site-footer { text-align: center; margin-top: 40px; color: rgba(255,255,255,0.85); }
.page-form .site-footer { color: var(--muted); }
.site-footer img { width: 56px; height: 56px; object-fit: contain; opacity: .9; margin-bottom: 8px; }
.site-footer p { font-size: .85rem; }

/* ---------- Success page ---------- */
.success-card { max-width: 520px; text-align: center; padding: 48px 36px; }
.success-icon { margin-bottom: 18px; }
.sc-circle { stroke: #1f8a52; stroke-width: 2.5; stroke-dasharray: 160; stroke-dashoffset: 160; animation: draw .7s ease forwards; }
.sc-check { stroke: #1f8a52; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 48; stroke-dashoffset: 48; animation: draw .5s .6s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.success-card h1 { font-size: 1.6rem; color: var(--ocean-800); margin-bottom: 12px; }
.success-text { color: var(--muted); margin-bottom: 22px; }
.success-meta { display: inline-flex; gap: 8px; align-items: center; background: rgba(31,127,184,0.08); padding: 8px 16px; border-radius: 999px; margin-bottom: 26px; }
.success-meta strong { color: var(--ocean-700); font-family: var(--font); }

/* ---------- Login ---------- */
.login-card { max-width: 420px; width: 100%; }
.login-logo { width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); display: grid; place-items: center; overflow: hidden; }
.login-logo img { width: 86%; height: 86%; object-fit: contain; }
.login-card h1 { text-align: center; font-size: 1.4rem; color: var(--ocean-800); }
.login-sub { text-align: center; color: var(--muted); margin: 6px 0 22px; font-size: .92rem; }
.login-card .field { margin-bottom: 16px; }
.login-card .link-muted { display: block; text-align: center; margin-top: 16px; }

/* ---------- Admin ---------- */
.admin-wrap { max-width: 1100px; }
.admin-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; margin-bottom: 26px;
}
.admin-brand { display: flex; align-items: center; gap: 16px; }
.admin-brand img { width: 64px; height: 64px; border-radius: 16px; background: #fff; padding: 6px; box-shadow: var(--shadow-sm); object-fit: contain; }
.admin-brand h1 { font-size: 1.5rem; color: var(--ocean-800); }
.admin-brand p { color: var(--muted); font-size: .9rem; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: var(--card); backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: var(--radius); padding: 22px; text-align: center;
    box-shadow: var(--shadow-sm);
    position: relative; overflow: hidden;
}
.stat-card::before { content: ""; position: absolute; top: 0; right: 0; left: 0; height: 4px; background: var(--grad-ocean); }
.stat-num { display: block; font-size: 2.2rem; font-weight: 800; color: var(--ocean-700); line-height: 1; }
.stat-label { color: var(--muted); font-size: .9rem; }

.table-card { padding: 18px; }
.table-toolbar { margin-bottom: 14px; }
.table-toolbar input { max-width: 360px; }
.table-scroll { overflow-x: auto; border-radius: var(--radius-sm); }
.data-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.data-table th, .data-table td { padding: 14px 12px; text-align: right; border-bottom: 1px solid var(--line); font-size: .92rem; }
.data-table th { color: var(--muted); font-weight: 700; font-size: .82rem; position: sticky; top: 0; background: rgba(255,255,255,0.95); }
.data-table tbody tr { transition: background .15s; }
.data-table tbody tr:hover { background: rgba(31,127,184,0.05); }
.data-table .strong { font-weight: 700; color: var(--ocean-800); }
.data-table .muted { color: var(--muted); }
.data-table .ltr { direction: ltr; text-align: right; }
.nowrap { white-space: nowrap; }
.no-results { text-align: center; color: var(--muted); padding: 30px; }

.empty-state { text-align: center; padding: 50px 20px; }
.empty-emoji { font-size: 3rem; margin-bottom: 10px; }
.empty-state h3 { color: var(--ocean-800); }
.empty-state p { color: var(--muted); }

/* ---------- Detail ---------- */
.detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 22px; align-items: start; }
.detail-card { display: flex; flex-direction: column; }
.detail-title { font-size: 1.05rem; color: var(--ocean-700); margin: 22px 0 12px; padding-bottom: 8px; border-bottom: 2px solid rgba(31,127,184,0.15); }
.detail-title:first-child { margin-top: 0; }
.detail-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.detail-list > div { background: rgba(31,127,184,0.05); border-radius: var(--radius-sm); padding: 12px 14px; }
.detail-list dt { font-size: .78rem; color: var(--muted); margin-bottom: 4px; }
.detail-list dd { font-weight: 700; color: var(--ocean-800); word-break: break-word; }
.detail-text { color: var(--ink); background: rgba(31,127,184,0.04); border-radius: var(--radius-sm); padding: 14px; }
.service-list { padding-inline-start: 22px; display: flex; flex-direction: column; gap: 6px; }
.service-list li { padding: 4px 0; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { background: rgba(31,127,184,0.12); color: var(--ocean-700); padding: 6px 14px; border-radius: 999px; font-size: .85rem; font-weight: 600; }

.detail-side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 20px; }
.side-card { padding: 20px; }
.logo-preview { display: block; background: #fff; border-radius: var(--radius-sm); padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.logo-preview img { width: 100%; height: 180px; object-fit: contain; }
.consent-state { text-align: center; font-weight: 700; padding: 12px; border-radius: var(--radius-sm); background: #fdecec; color: #c23b30; }
.consent-state.ok { background: #e7f7ee; color: #1f8a52; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s cubic-bezier(.2,.7,.3,1), transform .7s cubic-bezier(.2,.7,.3,1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
    .detail-grid { grid-template-columns: 1fr; }
    .detail-side { position: static; }
}
@media (max-width: 640px) {
    .container { padding: 28px 14px 48px; }
    .card { padding: 22px 18px; }
    .grid { grid-template-columns: 1fr; }
    .detail-list { grid-template-columns: 1fr; }
    .stats { grid-template-columns: 1fr; }
    .hero-logo { width: 104px; height: 104px; }
    .form-actions { justify-content: center; }
    .dropzone-layout { flex-direction: column; text-align: center; }
    .dropzone-inner { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .reveal { opacity: 1; transform: none; }
}
