@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');

/* 이음북 IEUMBOOK Premium SaaS Design System */
:root {
    --saas-primary: #6366f1; /* Indigo */
    --saas-primary-dark: #4f46e5;
    --saas-secondary: #0ea5e9; /* Sky */
    --saas-accent: #f43f5e; /* Rose */
    --saas-bg: #ffffff;
    --saas-bg-alt: #f8fafc;
    --saas-text: #0f172a;
    --saas-text-muted: #64748b;
    --saas-border: #e2e8f0;
    --saas-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --saas-shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --saas-radius: 12px;
    --saas-font: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

body.saas-landing {
    font-family: var(--saas-font);
    color: var(--saas-text);
    background: var(--saas-bg);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== Header & Nav ===== */
.saas-header {
    height: 80px;
    display: grid;
    /* 고정 너비 대신 auto 1fr auto로 변경하여 유연성 확보 */
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: 0 5%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--saas-border);
}

.saas-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--saas-primary);
    text-decoration: none;
    letter-spacing: -0.02em;
    justify-self: start;
}

.saas-nav {
    display: flex;
    gap: 40px;
    align-items: center;
    justify-self: center; /* 그리드 중앙 정렬 */
}

.saas-header-right {
    justify-self: end;
}

/* 패드 및 모바일 대응 (전체적인 한 줄 레이아웃 유지) */
@media (max-width: 1024px) {
    .saas-header { 
        height: 70px; 
        padding: 0 3%; 
        gap: 10px;
    }
    .saas-nav { 
        gap: clamp(8px, 1.5vw, 20px); /* 화면 너비에 따라 간격 유동적 조절 */
    }
    .saas-logo { font-size: clamp(1rem, 2vw, 1.25rem); }
    .saas-nav-link { font-size: clamp(0.75rem, 1.2vw, 0.875rem); }
    .saas-btn { padding: 8px 16px; font-size: clamp(0.75rem, 1.2vw, 0.875rem); }
}

/* 7인치 패드 세로 및 소형 모바일 (약 600px 이하) 추가 최적화 */
@media (max-width: 640px) {
    .saas-header { 
        padding: 0 10px;
        gap: 5px;
    }
    .saas-nav { gap: 8px; }
    .saas-logo { font-size: 0.95rem; }
    .saas-btn { padding: 6px 12px; font-size: 0.75rem; }
}

.saas-nav-link {
    text-decoration: none;
    color: var(--saas-text-muted);
    font-weight: 600;
    font-size: 0.9375rem;
    transition: color 0.2s;
}

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

.saas-btn {
    padding: 12px 24px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.saas-btn-primary {
    background: var(--saas-primary);
    color: #fff;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.39);
}

.saas-btn-primary:hover {
    background: var(--saas-primary-dark);
    transform: translateY(-2px);
}

/* ===== Hero Section (Legacy – fallback) ===== */
.saas-hero {
    padding: 120px 5% 80px;
    text-align: center;
    background: radial-gradient(circle at top left, #f3f4ff 0%, #ffffff 50%);
}
.saas-hero-badge { display:inline-block; padding:6px 16px; background:#eef2ff; color:var(--saas-primary); border-radius:20px; font-weight:700; font-size:0.8125rem; margin-bottom:24px; }
.saas-hero-title { font-size:clamp(2.5rem,5vw,4rem); font-weight:800; line-height:1.1; margin-bottom:24px; letter-spacing:-0.03em; }
.saas-hero-title span { background:linear-gradient(90deg,var(--saas-primary),var(--saas-secondary)); -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; }
.saas-hero-desc { max-width:600px; margin:0 auto 40px; font-size:1.125rem; color:var(--saas-text-muted); }

/* ===== Hero Section – Editorial ===== */
.hero-ed {
    background: #f0ede8;
    overflow: hidden;
    position: relative;
    padding: 0;
    min-height: 620px;
}

.hero-ed-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 36px 5% 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

/* 상단 레이블 행 */
.hero-ed-toprow {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
    position: relative;
    z-index: 3;
}
.hero-ed-brand-label {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #4a4a5a;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.hero-ed-right-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #8a8a9a;
    letter-spacing: .08em;
}

/* 대형 배경 타이포 */
.hero-ed-title-wrap {
    position: relative;
    z-index: 1;
    line-height: 1;
    margin-bottom: -0.05em;
    pointer-events: none;
    user-select: none;
}
.hero-ed-title {
    font-size: clamp(4.5rem, 14vw, 13rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    color: #1a1a22;
    line-height: 0.88;
    margin: 0;
    font-stretch: condensed;
}

/* 중간 콘텐츠 행 */
.hero-ed-midrow {
    display: grid;
    grid-template-columns: 160px 1fr 160px;
    align-items: flex-end;
    gap: 0;
    position: relative;
    z-index: 2;
    margin-top: -4vw;
}

/* 서비스 목록 */
.hero-ed-services {
    list-style: none;
    padding: 0 0 60px 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.hero-ed-services li {
    font-size: clamp(0.875rem, 1.4vw, 1.1rem);
    font-weight: 800;
    color: #1a1a22;
    letter-spacing: -0.01em;
}

/* ── 디바이스 목업 ── */
.hero-ed-device {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.hero-device-screen {
    width: min(520px, 72vw);
    background: #1c1c2e;
    border-radius: 14px 14px 0 0;
    border: 9px solid #2e2e42;
    box-shadow: 0 -4px 32px rgba(0,0,0,.25), inset 0 0 0 1px rgba(255,255,255,.06);
    overflow: hidden;
    position: relative;
}
.hero-device-screen::before {
    content:'';
    position:absolute;
    top:0; left:0; right:0;
    height:3px;
    background: linear-gradient(90deg,#6366f1,#a78bfa,#38bdf8);
    opacity:.7;
}
.hero-device-screen-inner {
    padding: 10px 14px 14px;
    min-height: 300px;
}

/* 화면 상단 바 */
.hero-screen-bar {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 12px;
}
.hero-screen-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}

/* 이북 선반 */
.hero-shelf {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    padding-bottom: 8px;
}
.hero-shelf-line {
    height: 4px;
    background: linear-gradient(90deg, rgba(255,255,255,.12), rgba(255,255,255,.06));
    border-radius: 2px;
    margin-bottom: 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.hero-book {
    width: 60px;
    height: 86px;
    border-radius: 3px 6px 6px 3px;
    background: linear-gradient(160deg, var(--c1), var(--c2));
    position: relative;
    box-shadow: 2px 3px 10px rgba(0,0,0,.35);
    flex-shrink: 0;
}
.hero-book::before {
    content:'';
    position:absolute;
    left:0; top:0; bottom:0;
    width:5px;
    background: rgba(0,0,0,.18);
    border-radius:3px 0 0 3px;
}
.hero-book::after {
    content:'Vol.'attr(data-vol);
    position:absolute;
    bottom:6px; left:0; right:0;
    text-align:center;
    font-size:6px;
    color:rgba(0,0,0,.5);
    font-weight:700;
}

/* 노트북 아랫부분 */
.hero-device-chin {
    width: min(520px, 72vw);
    height: 18px;
    background: linear-gradient(180deg,#2e2e42,#3a3a52);
    display:flex; align-items:center; justify-content:center;
}
.hero-device-notch {
    width: 60px; height: 8px;
    background: #1a1a2e;
    border-radius: 0 0 6px 6px;
}
.hero-device-base {
    width: min(560px, 78vw);
    height: 10px;
    background: linear-gradient(180deg,#3a3a52,#c8c6c2);
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,.2);
}
.hero-device-foot {
    width: min(340px, 48vw);
    height: 6px;
    background: #b0aeaa;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

/* 원형 뱃지 */
.hero-ed-badge-circle {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #db2777, #f97316);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 14px;
    box-sizing: border-box;
    box-shadow: 0 8px 32px rgba(124,58,237,.4);
    margin-bottom: 48px;
    animation: heroBadgePulse 3s ease-in-out infinite;
    align-self: flex-end;
    flex-shrink: 0;
}
.hero-ed-badge-circle span {
    font-size: 0.75rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.5;
    letter-spacing: -.01em;
}
@keyframes heroBadgePulse {
    0%,100% { transform:scale(1) rotate(-2deg); }
    50%      { transform:scale(1.05) rotate(2deg); }
}

/* CTA 영역 */
.hero-ed-cta {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 32px 0 44px;
    position: relative;
    z-index: 3;
}
.hero-ed-cta-btn {
    padding: 14px 38px !important;
    font-size: 1rem !important;
    border-radius: 999px;
    box-shadow: 0 6px 20px rgba(99,102,241,.35);
}
.hero-ed-cta-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: #4a4a5a;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color .2s;
}
.hero-ed-cta-link:hover { color: var(--saas-primary); }

/* 반응형 */
@media (max-width: 900px) {
    .hero-ed-midrow { grid-template-columns: 120px 1fr 120px; }
    .hero-ed-badge-circle { width:110px; height:110px; }
    .hero-ed-badge-circle span { font-size:.68rem; }
}
@media (max-width: 680px) {
    .hero-ed-midrow { grid-template-columns: 0 1fr 0; }
    .hero-ed-services, .hero-ed-badge-circle { display:none; }
    .hero-ed-title { font-size: clamp(3rem,18vw,5.5rem); }
    .hero-ed-cta { justify-content:center; }
}

/* ===== Pricing Section ===== */
.saas-pricing {
    padding: 100px 5%;
    background: var(--saas-bg-alt);
}

.saas-section-head {
    text-align: center;
    margin-bottom: 60px;
}

.saas-section-title {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 16px;
}

.saas-pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto;
}

.saas-price-card {
    background: #fff;
    padding: 48px;
    border-radius: var(--saas-radius);
    border: 1px solid var(--saas-border);
    transition: all 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
}

.saas-price-card.featured {
    border-color: var(--saas-primary);
    box-shadow: var(--saas-shadow-lg);
    transform: scale(1.05);
    z-index: 10;
}

@media (max-width: 1024px) {
    .saas-pricing-grid {
        display: flex;
        overflow-x: auto;
        padding: 20px 5% 40px; /* 요약된 카드 쉐도우를 위한 패딩 */
        gap: 20px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox 스크롤바 숨김 */
        margin: 0 -5%; /* 부모 패딩 상쇄를 위한 마진 */
    }
    .saas-pricing-grid::-webkit-scrollbar {
        display: none; /* Chrome/Safari 스크롤바 숨김 */
    }
    .saas-price-card {
        min-width: 320px; /* 기존 카드 느낌을 살리도록 축소하지 않음 */
        flex-shrink: 0;
        scroll-snap-align: center;
        padding: 48px 40px; /* 원본 패딩에 가깝게 복구 */
    }
    .saas-price-card.featured { transform: none; }
}

.saas-price-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--saas-primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 99px;
}

.saas-price-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.saas-price-val {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 24px;
}

.saas-price-val span {
    font-size: 1rem;
    color: var(--saas-text-muted);
}

.saas-price-list {
    list-style: none;
    padding: 0;
    margin: 0 0 40px;
    flex: 1;
}

.saas-price-list li {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9375rem;
}

.saas-price-list li i { color: #10b981; }

.saas-price-list li.disabled {
    color: var(--saas-text-muted);
    opacity: 0.6;
}

.saas-price-list li.disabled i { color: var(--saas-border); }

/* ===== Features ===== */
.saas-features {
    padding: 100px 5%;
}

.saas-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.saas-feature-item {
    padding: 32px;
    border-radius: var(--saas-radius);
    background: var(--saas-bg-alt);
    transition: transform 0.2s;
}

.saas-feature-item:hover { transform: translateY(-8px); }

.saas-feature-icon {
    width: 48px;
    height: 48px;
    background: #fff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--saas-primary);
    margin-bottom: 20px;
    box-shadow: var(--saas-shadow);
}

.saas-feature-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.saas-feature-desc {
    font-size: 0.9375rem;
    color: var(--saas-text-muted);
}

/* ===== Book Showcase ===== */
.saas-showcase {
    padding: 100px 5%;
    background: var(--saas-bg-alt);
}

/* ===== Modal System ===== */
.saas-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: modalFadeIn 0.3s ease;
}

.saas-modal-backdrop.active { display: flex; }

.saas-modal {
    background: #fff;
    width: 95%;
    max-width: 480px; /* 필드가 많아져서 약간 너비 확장 */
    max-height: 90vh; /* 화면을 넘지 않도록 제한 */
    overflow-y: auto; /* 내용이 많을 시 스크롤 지원 */
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

@media (max-width: 640px) {
    .saas-modal { padding: 30px 20px; }
    #registerForm > div[style*="grid"] {
        grid-template-columns: 1fr !important; /* 모바일에서는 기관명/부서를 1열로 */
        gap: 0 !important;
    }
}

.saas-modal-backdrop.active .saas-modal { transform: translateY(0); }

.saas-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--saas-bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--saas-text-muted);
    transition: all 0.2s;
    border: none;
}

.saas-modal-close:hover { background: #fee2e2; color: #ef4444; }

.saas-auth-tabs {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--saas-border);
}

.saas-auth-tab {
    flex: 1;
    text-align: center;
    padding: 12px;
    font-weight: 700;
    color: var(--saas-text-muted);
    cursor: pointer;
    position: relative;
}

.saas-auth-tab.active { color: var(--saas-primary); }
.saas-auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--saas-primary);
}

.saas-form-group { margin-bottom: 20px; }
.saas-form-label { display: block; font-size: 0.875rem; font-weight: 600; margin-bottom: 8px; }
.saas-form-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid var(--saas-border);
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.saas-form-input:focus { border-color: var(--saas-primary); }

.saas-auth-form { display: none; }
.saas-auth-form.active { display: block; }

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
