/* ==========================================================================
   PORTAL PENDAFTARAN - PESANTREN PUTRI AL-MAWADDAH
   Modern Responsive Design System (Desktop to Mobile)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #1d4ed8;
    --primary-hover: #1e40af;
    --primary-light: #eff6ff;
    --primary-gradient: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    --secondary: #0f172a;
    --accent: #10b981;
    --warning: #f59e0b;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --bg-page: #f8fafc;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    --border-radius: 16px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 30px -4px rgba(0, 0, 0, 0.1);
    --shadow-primary: 0 8px 20px rgba(37, 99, 235, 0.25);
    --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: inline-block;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
}

.w-100 {
    width: 100% !important;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 0.925rem;
    font-weight: 600;
    padding: 10px 22px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
    box-sizing: border-box;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #ffffff !important;
    border: none;
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
    background: #ffffff;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: var(--primary) !important;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--primary) !important;
    border: 1.5px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary-light);
    color: var(--primary-hover) !important;
}

.btn-lg {
    padding: 13px 26px;
    font-size: 1rem;
    border-radius: var(--radius-md);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

/* ==========================================================================
   NAVBAR
   ========================================================================== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1050;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    padding: 12px clamp(16px, 3vw, 40px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex-shrink: 1;
}

.nav-left img {
    height: 38px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.site-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--secondary);
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-links {
    display: flex;
    align-items: center;
    list-style: none;
}

.nav-links-inner {
    display: flex;
    align-items: center;
    gap: 26px;
}

.nav-item-link {
    display: inline-block;
    color: #475569;
    font-weight: 500;
    font-size: 0.94rem;
    position: relative;
    padding: 8px 0;
    transition: color 0.2s ease;
    text-decoration: none;
    line-height: 1.4;
}

.nav-item-link:hover {
    color: var(--primary);
}

.nav-item-link.active {
    color: var(--primary);
    font-weight: 600;
}

.nav-item-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.nav-auth-desktop {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-auth-mobile {
    display: none;
}

.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 26px;
    color: var(--secondary);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    line-height: 1;
}

.nav-toggle:hover {
    background: #f1f5f9;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero {
    position: relative;
    padding: 56px 20px 48px;
    text-align: center;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-content {
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
}

.hero-tag {
    display: inline-block;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--primary);
    text-transform: uppercase;
    margin-bottom: 12px;
}

.hero-title {
    font-size: clamp(1.85rem, 4.5vw, 2.75rem);
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
    margin: 0 auto 10px;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.2vw, 1.2rem);
    font-weight: 600;
    color: #1e3a8a;
    margin: 0 auto 14px;
}

.hero-desc {
    font-size: clamp(0.92rem, 1.8vw, 1.05rem);
    color: #64748b;
    max-width: 640px;
    margin: 0 auto 28px;
    line-height: 1.65;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 auto;
    width: 100%;
    max-width: 580px;
}

/* Highlight Bar */
.highlights-bar {
    max-width: 1050px;
    width: 100%;
    margin: 32px auto 40px;
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    position: relative;
    box-sizing: border-box;
}

.highlight-item {
    display: flex;
    align-items: center;
    gap: 14px;
}

.highlight-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.highlight-text h5 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 2px;
}

.highlight-text p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

/* ==========================================================================
   CARDS / LAYANAN UTAMA
   ========================================================================== */
.section-title-wrap {
    text-align: center;
    margin-bottom: 30px;
    padding: 0 10px;
}

.section-tag {
    display: inline-block;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    background: var(--primary-light);
    padding: 4px 14px;
    border-radius: 50px;
    margin-bottom: 8px;
}

.section-heading {
    font-size: clamp(1.35rem, 3.5vw, 2.1rem);
    font-weight: 800;
    color: var(--secondary);
    letter-spacing: -0.01em;
}

.section-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    max-width: 580px;
    margin: 8px auto 0;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto 50px;
    padding: 0 16px;
    box-sizing: border-box;
}

.card {
    background: #ffffff;
    border-radius: var(--border-radius);
    padding: 24px 20px;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.12);
    border-color: #cbd5e1;
}

.card:hover::before {
    opacity: 1;
}

.card-img-wrap {
    height: 95px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.card img {
    max-height: 90px;
    width: auto;
    object-fit: contain;
    transition: var(--transition);
}

.card:hover img {
    transform: scale(1.06);
}

.card h4 {
    color: var(--secondary);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.5;
    flex-grow: 1;
}

.card .btn {
    width: 100%;
}

/* ==========================================================================
   ALUR PENDAFTARAN (TIMELINE & 2X2 GRID MOBILE)
   ========================================================================== */
.steps-section {
    padding: 50px 16px;
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 50px;
    width: 100%;
    box-sizing: border-box;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    max-width: 1100px;
    width: 100%;
    margin: 32px auto 0;
    box-sizing: border-box;
}

.step-card {
    background: var(--bg-page);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px 16px;
    position: relative;
    text-align: left;
    transition: var(--transition);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.step-card:hover {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.step-num {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.step-card h5 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 6px;
}

.step-card p {
    font-size: 0.83rem;
    color: var(--text-muted);
    line-height: 1.45;
}

/* ==========================================================================
   VIDEO SECTION
   ========================================================================== */
.video-section {
    padding: 50px 16px;
    text-align: center;
    background: var(--bg-page);
    width: 100%;
    box-sizing: border-box;
}

.video-wrapper {
    max-width: 800px;
    width: 100%;
    margin: 24px auto 0;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    background: #000;
    aspect-ratio: 16 / 9;
    position: relative;
    box-sizing: border-box;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ==========================================================================
   FAQ SECTION (ACCORDION)
   ========================================================================== */
.faq {
    padding: 50px 16px;
    background: #ffffff;
    width: 100%;
    box-sizing: border-box;
}

.faq-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 20px 0 32px;
}

.faq-accordion {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-sizing: border-box;
}

.faq-item {
    background: var(--bg-page);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
}

.faq-item:hover {
    border-color: #cbd5e1;
}

.faq-header {
    width: 100%;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    color: var(--secondary);
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
}

.faq-icon {
    font-size: 1.05rem;
    color: var(--primary);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

.faq-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding: 0 20px;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

.faq-item.active .faq-body {
    max-height: 400px;
    padding-bottom: 18px;
}

/* ==========================================================================
   FLOATING WHATSAPP
   ========================================================================== */
.floating-wa {
    position: fixed;
    bottom: 22px;
    right: 22px;
    z-index: 1040;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #25d366;
    color: #ffffff !important;
    padding: 10px 18px;
    border-radius: 50px;
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.4);
    font-weight: 700;
    font-size: 0.9rem;
    transition: var(--transition);
    text-decoration: none;
}

.floating-wa i {
    font-size: 1.3rem;
}

.floating-wa:hover {
    background: #20ba5a;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 26px rgba(37, 211, 102, 0.5);
    color: #ffffff !important;
}

@media (max-width: 576px) {
    .floating-wa span {
        display: none;
    }
    .floating-wa {
        padding: 12px;
        border-radius: 50%;
        bottom: 18px;
        right: 18px;
    }
}

/* ==========================================================================
   TUTORIAL & DASHBOARD SHARED STYLES
   ========================================================================== */
.page-header {
    text-align: center;
    padding: 40px 16px 24px;
    background: linear-gradient(180deg, #f0f7ff 0%, #f8fafc 100%);
}

.page-header h1 {
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 8px;
}

.page-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.tutorial-content {
    max-width: 850px;
    width: 100%;
    margin: 0 auto 50px;
    padding: 28px 20px;
    background: #ffffff;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    box-sizing: border-box;
}

.tutorial-content h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 24px;
    margin-bottom: 14px;
}

.tutorial-content ol, .tutorial-content ul {
    margin-left: 20px;
    margin-bottom: 18px;
    color: var(--text-main);
}

.tutorial-content li {
    margin-bottom: 8px;
    line-height: 1.55;
}

.video-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    width: 100%;
}

.video-container iframe {
    width: 100%;
    max-width: 650px;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-md);
    border: none;
    box-shadow: var(--shadow-md);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 36px 16px;
    text-align: center;
    font-size: 0.88rem;
    border-top: 1px solid #1e293b;
    width: 100%;
    box-sizing: border-box;
}

footer p {
    margin-bottom: 6px;
    line-height: 1.55;
}

footer .footer-brand {
    font-weight: 700;
    color: #ffffff;
    font-size: 1.05rem;
    margin-bottom: 8px;
}

/* ==========================================================================
   RESPONSIVE DESIGN (TABLET & MOBILE)
   ========================================================================== */
@media (max-width: 991px) {
    .navbar {
        padding: 10px 14px;
    }

    .site-title {
        max-width: 200px;
    }

    /* Sembunyikan tombol auth desktop dari header bar mobile agar tidak overflow */
    .nav-auth-desktop {
        display: none !important;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        background: #ffffff;
        border-bottom: 2px solid var(--border-color);
        box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.16);
        z-index: 1050;
        max-height: calc(100vh - 65px);
        overflow-y: auto;
        padding: 0;
        box-sizing: border-box;
    }

    .nav-links.active {
        display: block;
        animation: slideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

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

    .nav-links-inner {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        padding: 16px 14px 20px;
        gap: 4px;
        width: 100%;
        box-sizing: border-box;
    }

    .nav-item-link {
        width: 100%;
        padding: 10px 14px;
        font-size: 0.95rem;
        font-weight: 500;
        border-radius: var(--radius-md);
        color: #334155;
        background: transparent;
        display: block;
        border-bottom: none;
        box-sizing: border-box;
        text-decoration: none;
        transition: background 0.15s ease, color 0.15s ease;
    }

    .nav-item-link:hover {
        background: #f1f5f9;
        color: var(--primary);
    }

    .nav-item-link.active {
        background: var(--primary-light);
        color: var(--primary);
        font-weight: 600;
    }

    .nav-item-link.active::after {
        display: none;
    }

    /* Pemisah & Bagian Auth Mobile */
    .nav-divider {
        height: 1px;
        background: var(--border-color);
        margin: 10px 0 12px;
        width: 100%;
    }

    .nav-auth-title {
        display: block;
        font-size: 0.78rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--text-muted);
        margin-bottom: 8px;
        padding-left: 4px;
    }

    .nav-auth-mobile {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
        padding: 0;
        margin: 0;
        box-sizing: border-box;
    }

    .nav-auth-mobile .btn {
        width: 100% !important;
        padding: 12px 18px !important;
        font-size: 0.95rem !important;
        border-radius: var(--radius-md) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        border-bottom: 1px solid transparent !important;
        box-sizing: border-box !important;
    }

    .nav-auth-mobile .btn-outline {
        background: #ffffff !important;
        border: 1.5px solid var(--primary) !important;
        color: var(--primary) !important;
    }

    .nav-auth-mobile .btn-outline:hover {
        background: var(--primary-light) !important;
    }

    .nav-auth-mobile .btn-primary {
        background: var(--primary-gradient) !important;
        color: #ffffff !important;
        border: none !important;
    }

    .hero {
        padding: 40px 14px 34px;
    }

    .highlights-bar {
        margin: -20px auto 30px;
        padding: 16px;
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* ==========================================================================
   MOBILE SCREEN (< 768px): ALUR PENDAFTARAN 2X2 GRID & FULL CENTERING
   ========================================================================== */
@media (max-width: 768px) {
    .site-title {
        font-size: 0.95rem;
        max-width: 180px;
    }

    .hero {
        padding: 36px 14px 30px;
    }

    .hero-badge {
        font-size: 0.78rem;
        padding: 5px 12px;
    }

    .hero-actions {
        width: 100%;
        max-width: 320px;
    }

    .hero-actions .btn {
        width: 100%;
    }

    /* 2 GRID DI MOBILE (ATAS 2, BAWAH 2) */
    .steps-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        margin-top: 24px;
    }

    .step-card {
        padding: 14px 10px;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .step-num {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
        margin-bottom: 8px;
    }

    .step-card h5 {
        font-size: 0.9rem;
        margin-bottom: 4px;
    }

    .step-card p {
        font-size: 0.75rem;
        line-height: 1.35;
    }

    .cards {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 0 12px;
    }

    .card {
        padding: 20px 16px;
    }

    .faq-header {
        padding: 14px 16px;
        font-size: 0.92rem;
    }

    .faq-body {
        padding: 0 16px;
        font-size: 0.88rem;
    }
}

@media (max-width: 380px) {
    .site-title {
        max-width: 140px;
        font-size: 0.88rem;
    }

    .steps-grid {
        gap: 8px !important;
    }

    .step-card {
        padding: 12px 8px;
    }

    .step-card h5 {
        font-size: 0.85rem;
    }

    .step-card p {
        font-size: 0.72rem;
    }
}
