/* ─── CSS Custom Properties ───────────────────────────────── */
:root {
    --primary-color:  #0d6efd;
    --primary-border: #1861ac;
    --link-color:     #0077cc;
    --focus-ring:     #258cfb;
    --selected-row:   #d4edda;
    --brand-navy:     #0d3b66;
    --brand-teal:     #1c6ea4;
}

body {
    font-family: 'Cairo', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ─── Landing - Hero wrapper (header + status card share this box) ──── */
.landing-hero {
    position: relative;
}

/* ─── Landing - Conference Header (full-width banner) ───────── */
.conference-header {
    background: linear-gradient(135deg, var(--brand-navy), var(--brand-teal));
    color: #fff;
    padding: 80px 20px 110px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.conference-header .header-decor {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(circle at 12% 20%, rgba(255,255,255,.10) 0%, rgba(255,255,255,0) 40%),
        radial-gradient(circle at 88% 15%, rgba(255,255,255,.08) 0%, rgba(255,255,255,0) 35%),
        radial-gradient(circle at 50% 100%, rgba(255,255,255,.08) 0%, rgba(255,255,255,0) 45%);
}

/* ─── Banner image (DB-driven, per conference) ───────────────────────────── */
.conference-header.has-banner {
    padding: 100px 20px 130px;
    min-height: 100vh;
    min-height: 100dvh; /* accounts for mobile browser chrome show/hide */
}

/* Fit the full-screen hero into exactly one screen (hero + footer, no
   scrolling) instead of a flat 100vh that always overflows past the shared
   sticky-footer chrome (.page-shell/.page-main/.footer, used by every page
   in Site.Master). Scoped with :has() to only this landing page's banner
   state - every other page keeps the normal min-height:100vh + natural
   scroll behavior below. Browsers without :has() fall back to the plain
   100vh rule above (scrolling to reach the footer), a safe degradation. */
@supports selector(:has(a)) {
    .page-shell:has(.landing-hero.has-banner) {
        height: 100vh;
        height: 100dvh;
    }

    .page-shell:has(.landing-hero.has-banner) .page-main {
        display: flex;
        flex-direction: column;
        flex: 1 1 0;
        min-height: 0;
    }

    .page-shell:has(.landing-hero.has-banner) .landing-hero {
        flex: 1 1 auto;
        width: 100%;
        min-height: 0;
    }

    .page-shell:has(.landing-hero.has-banner) .conference-header.has-banner {
        height: 100%;
        min-height: 0;
    }
}

.header-banner-img {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    animation: bannerKenBurns 20s ease-in-out infinite alternate;
}

.header-banner-overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(135deg, rgba(13,59,102,.82), rgba(28,110,164,.55));
}

@keyframes bannerKenBurns {
    from { transform: scale(1);    }
    to   { transform: scale(1.09); }
}

@media (prefers-reduced-motion: reduce) {
    .header-banner-img { animation: none; }
}

.conference-header .header-inner {
    position: relative;
    z-index: 2;
    max-width: 720px;
    margin: 0 auto;
}

.conference-header .brand-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    font-size: 1rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    opacity: .85;
}

.conference-header .brand-name {
    font-weight: 600;
    font-size: .85rem;
}

.conference-header .conf-title {
    font-size: clamp(1.8rem, 4.5vw, 2.6rem);
    font-weight: 800;
    margin-bottom: 14px;
    line-height: 1.2;
}

.conference-header .conf-dates {
    opacity: .9;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,.12);
    padding: 6px 18px;
    border-radius: 999px;
}

/* ─── Landing - Status Card (overlaps header) ───────────────── */
.status-container {
    max-width: 640px;
    margin: -70px auto 60px;
    padding: 0 20px;
}

/* When a banner fills the whole screen, float the status card dead-center
   over it instead of just nudging it up over the header's bottom edge.
   .landing-hero (not .conference-header, which clips its own Ken Burns zoom
   with overflow:hidden) is the positioning context so the card is never cut off.
   max-width must be cancelled here: with inset:0 pinning left/right to 0 AND
   the base rule's max-width:640px still clamping the box, the position is
   over-constrained and the browser keeps left:0 - the box (and everything
   centered inside it) ends up flush left instead of spanning full width. The
   640px cap moves onto .status-card itself instead. */
.landing-hero.has-banner .status-container {
    position: absolute;
    inset: 0;
    z-index: 3;
    max-width: none;
    margin: 0;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    /* Dead-centering the card over the full hero height (align-items:center)
       puts it too close to (or overlapping) .header-inner's text above it -
       the header's own content sits near the top, but a pure vertical center
       is computed against the whole hero box regardless of how tall that
       content is. This isn't just a narrow-phone problem: the same overlap
       reproduces on an ordinary desktop window at 125-200% browser zoom,
       since zooming shrinks the *effective* CSS viewport (both width and
       height) the same way a narrower/shorter window would. So this can't be
       gated behind a max-width media query - it has to hold at every size.
       clamp() reserves a floor of top space that scales with viewport height:
       280px covers the shortest realistic case (a zoomed-in landscape
       phone), 42vh scales it up through phone-portrait and mid-size desktop
       zoom levels, and the 420px ceiling stops it from pushing the card too
       far down on a tall, unzoomed desktop window. */
    padding-top: clamp(280px, 42vh, 420px);
}

.landing-hero.has-banner .status-container .status-card {
    width: 100%;
    max-width: 640px;
    /* Fully transparent fill so the banner shows through untouched. Text
       legibility here relies on .header-banner-overlay's dark gradient
       (already painted behind the whole hero, card included) plus the white
       text color below, rather than any blur/tint of our own. */
    background: transparent;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}

.landing-hero.has-banner .status-container .status-card .card-heading {
    color: #fff;
}

.landing-hero.has-banner .status-container .status-card .card-body-text {
    color: rgba(255, 255, 255, .85);
}

.status-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 48px rgba(13,59,102,.16);
    padding: 48px 40px;
}

.status-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
}

.status-icon-closed {
    background: #fdeeea;
    color: #c8492f;
}

.status-card .card-heading {
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: #16324f;
}

.status-card .card-body-text {
    color: #667;
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 0;
}

.status-card .btn-cta {
    padding: 12px 44px;
    font-weight: 700;
    border-radius: 999px;
    box-shadow: 0 10px 24px rgba(13,110,253,.28);
    transition: transform .15s ease, box-shadow .15s ease;
}

.status-card .btn-cta:hover,
.status-card .btn-cta:focus {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(13,110,253,.34);
}

/* ─── Responsive base font ───────────────────────────────── */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

/* ─── Page-level entrance (applies to every page's main content) ────────── */
main {
    animation: pageFadeIn .3s ease;
}

@keyframes pageFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@media (min-width: 768px) {
    html { font-size: 16px; }
}

/* ─── Sticky footer (flex column - footer never overlaps content,
       regardless of its actual rendered height) ─────────────────────── */
.page-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-main {
    flex: 1 0 auto;
}

/* ─── Brand bar (logo, top-left, every page) ────────────── */
.site-brand-bar {
    padding: 14px 20px;
    flex-shrink: 0;
    background: #eaf4fd;
}

.site-logo-link {
    display: inline-block;
}

.site-logo {
    height: 64px;
    width: auto;
    display: block;
}

/* ─── Focus ring (inputs + buttons) ─────────────────────── */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* ─── Navbar brand ───────────────────────────────────────── */
a.navbar-brand {
    white-space: normal;
    text-align: center;
    word-break: break-all;
}

/* ─── Link color ─────────────────────────────────────────── */
a { color: #0077cc; }

/* ─── Primary button ─────────────────────────────────────── */
.btn-primary {
    color: #fff;
    background-color: #0d6efd;
    border-color: #1861ac;
}
.btn-primary:hover,
.btn-primary:focus {
    background-color: #0b5ed7;
    border-color: #1861ac;
}

/* ─── Nav pills ──────────────────────────────────────────── */
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    color: #fff;
    background-color: #0d6efd;
    border-color: #1861ac;
}

/* ─── Borders ────────────────────────────────────────────── */
.border-top    { border-top:    1px solid #e5e5e5; }
.border-bottom { border-bottom: 1px solid #e5e5e5; }

/* ─── Box shadow ─────────────────────────────────────────── */
.box-shadow { box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); }

/* ─── Footer ─────────────────────────────────────────────── */
.footer {
    flex-shrink: 0;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px 12px;
    border-top: 1px solid #e5e9ee;
    padding-inline: 12px;
    box-sizing: border-box;
}

.footer > * {
    min-width: 0;
}

.footer small {
    overflow-wrap: break-word;
    text-align: center;
}

.footer .lang-toggle-btn {
    border-radius: 999px;
    font-weight: 600;
    padding: 4px 16px;
}

/* ─── Table row selection ────────────────────────────────── */
.selected-row { background-color: #d4edda !important; }

/* ─── Table scroll container ─────────────────────────────── */
.table-scroll {
    max-height: 350px;
    max-width: 100%;
    overflow: auto;
}

/* ─── Submission Page ────────────────────────────────────────────────────── */
.submission-page .page-title {
    font-weight: 800;
    color: #16324f;
}

.section-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(13,59,102,.08);
    padding: 32px;
    border: 1px solid #eef1f4;
}

.section-heading {
    font-size: 1.15rem;
    font-weight: 700;
    color: #16324f;
    margin-bottom: 20px;
}

/* ─── Poster template download - highlighted callout ─────────────────────── */
.template-highlight {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff8e1;
    border: 1px solid #f5c751;
    border-left: 5px solid #f0a500;
    border-radius: 10px;
    padding: 14px 18px;
}

[dir="rtl"] .template-highlight {
    border-left: 1px solid #f5c751;
    border-right: 5px solid #f0a500;
}

.template-highlight-icon {
    font-size: 1.75rem;
    color: #b3720a;
    flex-shrink: 0;
}

.template-highlight-caption {
    font-size: .95rem;
    color: #7a5300;
    margin-bottom: 2px;
}

.template-highlight-link {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: underline;
}

.template-highlight-link:hover {
    color: var(--primary-border);
}

/* ─── Stepper ─────────────────────────────────────────────────────────────── */
.stepper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    row-gap: 10px;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    opacity: .45;
    transition: opacity .25s ease;
    min-width: 0;
}

.step-item.step-active,
.step-item.step-done {
    opacity: 1;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9edf1;
    color: #6c7a89;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    transition: background .25s ease, color .25s ease, transform .25s ease;
}

.step-item.step-active .step-circle {
    background: var(--primary-color);
    color: #fff;
    transform: scale(1.08);
}

.step-item.step-done .step-circle {
    background: var(--primary-color);
    color: #fff;
}

.step-check { display: none; }
.step-item.step-done .step-number { display: none; }
.step-item.step-done .step-check  { display: inline; }

.step-label {
    font-size: 13px;
    font-weight: 600;
    color: #556;
    text-align: center;
}

@media (max-width: 576px) {
    .step-label {
        display: none;
    }
    .stepper {
        gap: 8px;
    }
    .step-line {
        flex: 1 1 20px;
        max-width: 40px;
    }
    .step-circle {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }
}

@media (max-width: 360px) {
    .step-circle {
        width: 26px;
        height: 26px;
        font-size: 12px;
    }
    .step-line {
        max-width: 24px;
    }
}

.step-line {
    flex: 1 1 40px;
    max-width: 80px;
    height: 2px;
    background: #e9edf1;
    margin-bottom: 22px;
}

/* ─── Form alerts ─────────────────────────────────────────────────────────── */
.form-alert {
    animation: shakeIn .35s ease;
}

@keyframes shakeIn {
    0%   { transform: translateX(0); opacity: 0; }
    30%  { transform: translateX(-6px); opacity: 1; }
    60%  { transform: translateX(4px); }
    100% { transform: translateX(0); }
}

/* ─── Section entrance animation ─────────────────────────────────────────── */
.animate-in {
    animation: fadeInUp .4s ease both;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Input group icons ──────────────────────────────────────────────────── */
.input-group-text {
    background: #f4f7fa;
    color: #7a8794;
}

/* ─── AD auto-fill flash ─────────────────────────────────────────────────── */
@keyframes flashFill {
    0%   { background-color: #fff9db; }
    100% { background-color: #e9ecef; }
}
.flash-fill { animation: flashFill 1.1s ease; }

/* ─── Poster drag & drop zone ─────────────────────────────────────────────── */
.dropzone {
    position: relative;
    border: 2px dashed #c9d3dc;
    border-radius: 14px;
    padding: 28px 16px;
    text-align: center;
    transition: border-color .2s ease, background .2s ease;
    background: #fafbfc;
}

.dropzone.drag-active {
    border-color: var(--primary-color);
    background: #eef6ff;
}

.dropzone.has-file {
    border-style: solid;
    border-color: #1e8a4c;
    background: #f1faf4;
}

.dropzone-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    pointer-events: none;
}

.dropzone-icon {
    font-size: 1.8rem;
    color: var(--primary-color);
}

.dropzone.has-file .dropzone-icon {
    color: #1e8a4c;
}

.dropzone-hint {
    font-size: 13px;
    color: #778;
}

.dropzone-filename {
    font-size: 13px;
    font-weight: 600;
    color: #16324f;
    word-break: break-all;
}

.btn-remove-file {
    position: absolute;
    top: 8px;
    inset-inline-end: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
    color: #c8492f;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    z-index: 3;
}

.dropzone.has-file .btn-remove-file {
    display: flex;
}

/* ─── Loading buttons ─────────────────────────────────────────────────────── */
.btn-lookup.is-loading,
.btn-submit.is-loading {
    color: transparent !important;
    position: relative;
    pointer-events: none;
}

.btn-lookup.is-loading::after,
.btn-submit.is-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255,255,255,.5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btnSpin .6s linear infinite;
}

.btn-lookup.is-loading::after {
    border: 2px solid rgba(13,110,253,.3);
    border-top-color: var(--primary-color);
}

@keyframes btnSpin {
    to { transform: rotate(360deg); }
}

/* ─── Confirmation Page ───────────────────────────────────────────────────── */
.confirmation-page .confirmation-wrap {
    max-width: 640px;
    margin: 0 auto;
}

.confirmation-card {
    padding: 44px 40px 36px;
}

.success-check-wrap {
    width: 96px;
    height: 96px;
    margin: 0 auto 20px;
    position: relative;
}

.success-check-wrap::before {
    content: "";
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(30,138,76,.16) 0%, rgba(30,138,76,0) 70%);
    animation: pulseGlow 1.8s ease-in-out infinite;
}

.success-check-svg {
    width: 100%;
    height: 100%;
    position: relative;
}

.success-check-circle {
    fill: none;
    stroke: #1e8a4c;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 227;
    stroke-dashoffset: 227;
    animation: drawCircle .6s ease forwards;
}

.success-check-mark {
    fill: none;
    stroke: #1e8a4c;
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 52;
    stroke-dashoffset: 52;
    animation: drawCheck .4s ease forwards .55s;
}

@keyframes drawCircle { to { stroke-dashoffset: 0; } }
@keyframes drawCheck  { to { stroke-dashoffset: 0; } }
@keyframes pulseGlow {
    0%, 100% { transform: scale(1); opacity: .8; }
    50%      { transform: scale(1.12); opacity: 1; }
}

.confirmation-ref {
    margin-top: 18px;
    font-size: 13px;
    color: #778;
    letter-spacing: .02em;
}

.confirmation-ref-value {
    font-weight: 700;
    color: #16324f;
    margin-inline-start: 6px;
}

.confirmation-details {
    padding: 32px 36px;
}

.detail-rows {
    display: flex;
    flex-direction: column;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #eef1f4;
}

.detail-row > * {
    min-width: 0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 13px;
    font-weight: 600;
    color: #778;
}

.detail-value {
    font-size: 14px;
    font-weight: 600;
    color: #16324f;
    text-align: end;
}

.email-note {
    font-size: 14px;
}
