/* ══════════════════════════════════════════════════════
   css/index.css  –  MED-ED Home Page  (circuit-board bg)
════════════════════════════════════════════════════════ */

:root {
    --primary:   #1a3a6b;
    --primary-d: #122d5a;
    --accent:    #e8a020;
    --accent-d:  #cf8e1a;
    --bg:        #f4f6fb;
    --card:      #ffffff;
    --border:    #d0d8e8;
    --text:      #1a2540;
    --muted:     #7080a0;
    --red:       #c0392b;
    --green:     #27ae60;
    --yellow:    #f39c12;
}
@font-face {
    font-family: 'Oryn';
    src: url('../oryn.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { margin: 0; padding: 0; scroll-behavior: smooth; overflow-x: hidden; }
body { font-family: 'Sarabun', sans-serif; color: #fff; background: #020d1a; }

/* ══════════════════════════════════════════════════════
   HERO — full-screen background image
════════════════════════════════════════════════════════ */
.hero {
    position: relative;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
    background-image: url('../img/bg-pc.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

/* Top vignette so navbar is always readable */
.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 160px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.55) 0%, transparent 100%);
    z-index: 5;
    pointer-events: none;
}

/* ── Formal logos — top LEFT ── */
.hero-formal-logos {
    position: absolute;
    top: 18px;
    left: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10;
}
.formal-logo-box {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.formal-logo-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ── LEFT content: icon → wordmark (no description text) ── */
.hero-content {
    position: absolute;
    top: 50%;
    left: 4%;
    transform: translateY(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    max-width: 48%;
}

.hero-logo-icon {
    width: clamp(160px, 22vw, 280px);
    height: auto;
    object-fit: contain;
    filter:
        drop-shadow(0 0 24px rgba(0,180,255,0.4))
        drop-shadow(0 0 60px rgba(0,100,200,0.25))
        drop-shadow(0 6px 6px rgba(0,0,0,0.9))
        drop-shadow(0 12px 28px rgba(0,0,0,0.85))
        drop-shadow(0 20px 50px rgba(0,0,0,0.7));
}

.hero-logo-wordmark {
    width: clamp(260px, 36vw, 480px);
    height: auto;
    object-fit: contain;
    filter:
        drop-shadow(0 2px 4px rgba(0,0,0,1))
        drop-shadow(0 4px 16px rgba(0,0,0,0.95))
        drop-shadow(0 8px 32px rgba(0,0,0,0.85))
        drop-shadow(0 16px 48px rgba(0,0,0,0.7));
}

/* Description text — hidden as per request */
.hero-desc { display: none; }

/* ══════════════════════════════════════════════════════
   RIGHT — "CPIRD 2026" title + glass card
   These float together as one block on the right half
════════════════════════════════════════════════════════ */
.hero-right-block {
    position: absolute;
    top: 55%;
    right: 4%;
    transform: translateY(-52%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    z-index: 10;
    width: 42%;
    max-width: 560px;
}

.hero-cpird-title {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-family: 'Oryn', 'Orbitron', 'Prompt', sans-serif;
    font-size: clamp(1.6rem, 3vw, 2.6rem);
    font-weight: 300;
    color: #fff;
    letter-spacing: 0em;
    text-align: center;
    text-shadow:
        0 0 20px rgba(180, 220, 255, 0.85),
        0 0 60px rgba(100, 180, 255, 0.5),
        0 2px 4px rgba(0, 0, 0, 1),
        0 4px 12px rgba(0, 0, 0, 1),
        0 8px 24px rgba(0, 0, 0, 0.95),
        0 16px 40px rgba(0, 0, 0, 0.8);
}


/* The PNG frame sits on top as a pure overlay */
.hero-glass-card-wrap {
    position: relative;
    width: 92%;
    margin: 0 auto;
}

.hero-card-frame {
    position: absolute;
    inset: -22px -28px;
    width: calc(100% + 56px);
    height: calc(100% + 44px);
    object-fit: fill;
    pointer-events: none;
    z-index: 0;
}

.hero-glass-card {
    width: 100%;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    border-radius: 18px;
   padding: 60px 56px 54px;
    text-align: center;
    color: #fff;
    position: relative;
    z-index: 1;
    box-shadow: none;
}



.glass-card-top {
    font-size: 1rem;
    color: rgba(255,255,255,.85);
    margin-bottom: 24px;
    line-height: 1.6;
    letter-spacing: 0.02em;
    text-shadow: 0 0 12px rgba(100,180,255,0.4);
}

.btn-go-form {
    display: block;
    background: linear-gradient(135deg, #2257c5, #1a3a9a);
    color: #fff;
    padding: 16px 20px;
    border-radius: 12px;
    font-family: 'Prompt', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
    transition: all .2s;
    box-shadow: 0 4px 24px rgba(30,80,200,.45);
    letter-spacing: 0.02em;
}
.btn-go-form:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(30,80,200,.6);
    background: linear-gradient(135deg, #2a65e0, #1e47b8);
}

.glass-divider {
    font-size: .85rem;
    color: rgba(180, 220, 255, 0.7);
    margin: 22px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: 0.05em;
}
.glass-divider::before,
.glass-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(100,200,255,0.4), transparent);
}

.glass-card-bottom {
    font-size: .92rem;
    color: rgba(200, 230, 255, 0.88);
    line-height: 1.8;
    text-shadow: 0 1px 8px rgba(0,0,0,0.4);
}
.glass-card-bottom a {
    color: #a8d8ff;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid rgba(168, 216, 255, 0.45);
    padding-bottom: 1px;
    transition: color .15s, border-color .15s;
}
.glass-card-bottom a:hover { color: #fff; border-color: rgba(255,255,255,0.7); }

/* Scroll hint */
.scroll-hint {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: rgba(255,255,255,.3);
    font-size: .75rem;
    animation: bounce 2s infinite;
    z-index: 10;
}
.scroll-arrow { font-size: 1.1rem; }
@keyframes bounce {
    0%,100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(6px); }
}

/* ── CONTENT SECTION ── */
.content-section { background: var(--bg); padding: 64px 72px; }
.info-card-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 40px; }

/* ── LOGIN MODAL ── */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.65); z-index: 999;
    align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: #fff; border-radius: 18px;
    padding: 42px 38px; width: 90%; max-width: 420px;
    position: relative; box-shadow: 0 24px 64px rgba(0,0,0,.35);
    animation: popIn .25s cubic-bezier(.34,1.56,.64,1);
}
@keyframes popIn { from{transform:scale(.88);opacity:0} to{transform:scale(1);opacity:1} }
.modal-close {
    position: absolute; top: 14px; right: 16px;
    background: none; border: none; font-size: 1rem; color: var(--muted); cursor: pointer;
}
.modal-close:hover { color: var(--red); }
.modal-icon { font-size: 2.2rem; text-align: center; margin-bottom: 8px; }
.modal-box h3 {
    font-family: 'Prompt', sans-serif; font-size: 1.3rem; font-weight: 700;
    color: var(--primary); text-align: center; margin-bottom: 5px;
}
.modal-box > div > p { font-size: .83rem; color: var(--muted); text-align: center; margin-bottom: 20px; }
.login-error {
    background: #fff5f5; border: 1.5px solid #fca5a5; border-radius: 8px;
    padding: 9px 13px; font-size: .84rem; color: var(--red); font-weight: 600; margin-bottom: 14px;
}
.reset-success {
    background: #f0fdf4; border: 1.5px solid #86efac; border-radius: 8px;
    padding: 9px 13px; font-size: .84rem; color: #166534; font-weight: 600; margin-bottom: 14px;
}
.modal-field { margin-bottom: 14px; }
.modal-field label { display: block; font-size: .8rem; font-weight: 600; color: var(--primary); margin-bottom: 5px; }
.modal-field input[type=email],
.modal-field input[type=password],
.modal-field input[type=text] {
    width: 100%; padding: 10px 12px;
    border: 1.5px solid var(--border); border-radius: 8px;
    font-size: .88rem; font-family: 'Sarabun', sans-serif;
    color: var(--text); background: #fafbfe; outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.modal-field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,58,107,.1); background: #fff; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 40px; }
.pw-toggle {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; font-size: .95rem; color: var(--muted); padding: 0;
}
.pw-toggle:hover { color: var(--primary); }
.btn-modal-login {
    width: 100%; padding: 12px; background: var(--primary); color: #fff;
    border: none; border-radius: 9px; font-family: 'Prompt', sans-serif;
    font-size: .95rem; font-weight: 700; cursor: pointer;
    box-shadow: 0 4px 14px rgba(26,58,107,.3); transition: all .2s; margin-top: 4px;
}
.btn-modal-login:hover { background: var(--primary-d); transform: translateY(-1px); }
.btn-forgot {
    display: block; width: 100%; margin-top: 10px; padding: 9px;
    background: transparent; color: var(--muted);
    border: 1.5px solid var(--border); border-radius: 9px;
    font-family: 'Sarabun', sans-serif; font-size: .85rem; font-weight: 600;
    cursor: pointer; transition: all .15s; text-align: center;
}
.btn-forgot:hover { border-color: var(--primary); color: var(--primary); background: #f0f4ff; }
.modal-footer { text-align: center; font-size: .8rem; color: var(--muted); margin-top: 14px; }
.modal-footer a { color: var(--primary); font-weight: 600; text-decoration: none; }
.modal-footer a:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════
   RESPONSIVE — MOBILE
════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

    .hero-formal-logos {
        top: 14px;
        left: 12px;
        gap: 8px;
    }
    .formal-logo-box { width: 44px; height: 44px; }

    /* Icon + wordmark side-by-side row at top */
    .hero-content {
        position: absolute;
        top: 90px;
        left: 50%;
        transform: translateX(-50%);
        flex-direction: row;
        align-items: center;
        justify-content: center;
        text-align: left;
        width: 88%;
        max-width: none;
        gap: 12px;
    }
    .hero-logo-icon     { width: clamp(48px, 14vw, 72px); flex-shrink: 0; }
    .hero-logo-wordmark { width: clamp(160px, 55vw, 220px); }

    /* Smaller card, centered lower */
    .hero-right-block {
        position: absolute;
        top: auto;
        bottom: 8%;
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0;
        z-index: 10;
        width: 78%;
        max-width: 300px;
    }
    .hero-cpird-title {
        position: absolute;
        top: -44px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 1.3rem;
        font-weight: 300;
        white-space: nowrap;
        text-align: center;
    }
    .hero-glass-card  { padding: 22px 18px; }
    .btn-go-form      { font-size: .9rem; padding: 12px 14px; font-weight: 400; }
    .glass-card-top   { font-size: .85rem; margin-bottom: 16px; }
    .glass-divider    { margin: 14px 0; font-size: .8rem; }
    .glass-card-bottom { font-size: .82rem; }
    .scroll-hint      { display: none; }
}

@media (max-width: 480px) {
    .hero-glass-card    { padding: 26px 18px; }
    .hero-logo-icon     { width: clamp(90px, 30vw, 140px); }
    .hero-logo-wordmark { width: clamp(190px, 75vw, 280px); }
}

/* ══════════════════════════════════════════════════════
   CAROUSEL SECTION
════════════════════════════════════════════════════════ */
.carousel-section {
    background: linear-gradient(180deg, #020d1a 0%, #071428 60%, #0a1c38 100%);
    padding: 72px 0 80px;
    overflow: hidden;
}

.carousel-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 60px;
}

.carousel-heading {
    font-family: 'Prompt', sans-serif;
    font-size: clamp(1.3rem, 2.5vw, 2rem);
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin-bottom: 48px;
    letter-spacing: 0.04em;
    text-shadow: 0 0 30px rgba(100, 180, 255, 0.3);
}
.carousel-heading::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #2257c5, #4a9eff);
    border-radius: 2px;
    margin: 12px auto 0;
}

/* ── Slide cards ── */
.cpird-slide {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(100, 180, 255, 0.15);
    border-radius: 16px;
    padding: 36px 28px 32px;
    text-align: center;
    color: #fff;
    transition: border-color .3s, background .3s, transform .3s;
    height: auto;
    cursor: default;
}
.cpird-slide:hover {
    background: rgba(34, 87, 197, 0.12);
    border-color: rgba(100, 180, 255, 0.4);
    transform: translateY(-4px);
}

.slide-icon {
    font-size: 2.4rem;
    margin-bottom: 16px;
    display: block;
}
.slide-title {
    font-family: 'Prompt', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #a8d8ff;
    margin-bottom: 12px;
    letter-spacing: 0.02em;
}
.slide-body {
    font-size: .9rem;
    color: rgba(200, 220, 255, 0.75);
    line-height: 1.75;
}

/* ── Swiper nav overrides ── */
.cpird-prev,
.cpird-next {
    color: rgba(255,255,255,.5) !important;
    transition: color .2s;
}
.cpird-prev:hover,
.cpird-next:hover {
    color: #fff !important;
}
.cpird-prev::after,
.cpird-next::after {
    font-size: 1.1rem !important;
    font-weight: 700;
}

.cpird-pagination .swiper-pagination-bullet {
    background: rgba(255,255,255,.3);
    opacity: 1;
    transition: background .2s, transform .2s;
}
.cpird-pagination .swiper-pagination-bullet-active {
    background: #4a9eff;
    transform: scale(1.3);
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .carousel-inner { padding: 0 40px; }
    .cpird-slide { padding: 28px 20px 24px; }
}
@media (max-width: 480px) {
    .carousel-inner { padding: 0 48px; }
    .carousel-section { padding: 52px 0 60px; }
}