/* PSYCHOVPN 통합 스타일시트 */
/* Version: v0.3.1 - 2025-09-03 */

 /* forms */
.form-group .full {
	width: 100%;
	box-sizing: border-box;
}
.form-group input.full,
.form-group select.full,
.form-group textarea.full {
	display: block;
}
/* base64 키 가독성 향상 */
.mono {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* CSS 변수 정의 */
:root { 
    --bg: #0f1115; 
    --card: #161a20; 
    --text: #e6e9ef; 
    --muted: #9aa3ae; 
    --border: #23262b; 
    --accent: #4b83ff; 
    --good: #2ea043; 
    --error: #e5534b;
    
    /* FAQ/Renew 페이지용 추가 변수 */
    --bg-alt: #1a1a1a;
    --card-alt: #2d2d2d;
    --border-alt: #404040;
}

/* 기본 레이아웃 */
html, body { height: 100%; }
body { 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; 
    background: var(--bg); 
    color: var(--text); 
    margin: 0; 
    padding: 0;
}

/* 페이지별 body 설정 */
.page-index body { 
    max-width: 1000px; 
    margin: 72px auto 40px; 
    padding: 20px; 
}

.page-faq body, 
.page-renew body { 
    max-width: 980px; 
    margin: 112px auto 40px; /* 네비게이션 높이 고려 */
    padding: 20px; 
    background: var(--bg-alt); 
}

/* 상단 네비게이션 - 통합 */
.topnav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100; /* 통일된 z-index */
    background: #0f1115;
    border-bottom: 1px solid #23262b;
}

.topnav-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    font-weight: 800;
}

.brand small {
    color: #8a8f98;
    font-weight: 600;
}

.brand .zap {
    font-size: 28px;
    filter: drop-shadow(0 0 6px #ffd54d);
}

.navlinks {
    display: flex;
    gap: 12px;
}

.navlinks a {
    color: #d0d4da;
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid transparent;
}

.navlinks a:hover,
.navlinks a.active {
    color: #fff;
    border-color: #2a2f36;
    background: #161a20;
}

/* 카드 컴포넌트 */
.card {
    background: var(--card);
    padding: 24px;
    margin: 16px 0;
    border-radius: 12px;
    border: 1px solid var(--border);
}

/* Index 페이지 전용 카드 스타일 */
.page-index .card {
    padding: 30px;
    margin: 20px 0;
    border-radius: 14px;
    box-shadow: 0 6px 28px rgba(0,0,0,.35);
}

/* FAQ/Renew 페이지 전용 카드 스타일 */
.page-faq .card,
.page-renew .card {
    background: var(--card-alt);
    border: 1px solid var(--border-alt);
}

/* 제목 스타일 */
h1, h2 { margin: 0 0 10px 0; }
h1 { text-align: center; color: #ffffff; font-size: 34px; letter-spacing: 0.2px; }

/* 배너 (Index 전용) */
.banner {
    text-align: center;
    padding: 24px 18px;
    border-radius: 12px;
    border: 1px dashed #2a2f36;
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0));
}

.banner .title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.banner .beta {
    margin-top: 6px;
    font-size: 12px;
    color: #9aa3ae;
    letter-spacing: 0.6px;
}

.subtitle {
    text-align: center;
    color: var(--muted);
    margin-top: 10px;
}

/* 설명 섹션 */
.explainer {
    margin: 18px 0;
    text-align: center;
}

.explainer h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    color: #e8ebf2;
}

/* 버튼 스타일 */
button {
    padding: 12px 16px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    transition: transform .15s ease, background .2s;
}

button:hover {
    background: #3a6fe0;
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

button.secondary {
    background: #2a2f36;
    color: #d0d4da;
    border: 1px solid #313742;
}

button.secondary:hover {
    background: #222831;
}

button:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}

/* Renew 페이지 버튼 스타일 오버라이드 */
.page-renew button {
    background: #0d6efd;
    border-radius: 8px;
}

/* 폼 스타일 */
.form-group {
    margin: 14px 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-weight: 600;
}

/* Index 페이지 폼 스타일 */
.page-index .form-group select {
    width: 100%;
    padding: 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
}

/* FAQ/Renew 페이지 폼 스타일 */
.page-faq input, .page-faq select,
.page-renew input, .page-renew select {
    width: 100%;
    padding: 12px;
    border: 2px solid #4a4a4a;
    border-radius: 8px;
    background: #3a3a3a;
    color: #e0e0e0;
}

/* 플랜 그리드 */
.plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px,1fr));
    gap: 16px;
    margin: 20px 0;
}

.plan {
    border: 1px solid #2a2f36;
    border-radius: 12px;
    padding: 18px;
    text-align: center;
    background: #0f131a;
    color: #e0e0e0;
    transition: transform .15s ease, border-color .2s, background .2s;
}

.plan:hover {
    border-color: var(--accent);
    background: #101622;
    transform: translateY(-2px);
}

.plan.popular {
    border-color: var(--good);
    background: #0f1712;
}

.price {
    font-size: 24px;
    font-weight: 800;
    color: var(--good);
    margin: 10px 0;
}

/* 스토어 그리드 */
.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px,1fr));
    gap: 14px;
}

.store-card {
    display: block;
    padding: 16px;
    background: #0f131a;
    border: 1px solid #23262b;
    border-radius: 14px;
    text-align: center;
    text-decoration: none;
    color: #e0e0e0;
    transition: transform .15s, border-color .2s, background .2s;
}

.store-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    background: #0e1218;
}

.store-card .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 10px;
    border-radius: 14px;
    background: #0e1116;
    border: 1px solid #2a2f36;
    overflow: hidden;
}

.store-card .logo img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    image-rendering: auto;
}

.store-card .name {
    font-weight: 800;
}

/* 서버 상태 */
.status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #0f131a;
    border: 1px solid #23262b;
    padding: 8px 10px;
    border-radius: 10px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #777;
    box-shadow: 0 0 0 2px #242833 inset;
}

.status-dot.ok { background: var(--good); }
.status-dot.down { background: var(--error); }

/* 모달 시스템 */
.hidden { display: none; }

#overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 1000;
    display: none;
}

#paymentModal {
    position: fixed;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    width: min(560px, calc(100% - 32px));
    max-height: 80vh;
    overflow: auto;
}

/* SPA 뷰 시스템 */
.view { display: none; }
.view.active { display: block; }
#spa-slot .embedded-styles { display: block; }

/* QR 컨테이너 */
#qrCodeContainer {
    background: #0f131a;
    border: 1px solid #23262b;
    border-radius: 12px;
}

/* FAQ 전용 스타일 */
.container {
    max-width: 860px;
    margin: 0 auto;
}

.wrap {
    max-width: 800px;
    margin: 0 auto;
}

details {
    background: #262a30;
    border: 1px solid #363b43;
    border-radius: 10px;
    padding: 14px 16px;
    margin: 10px 0;
}

summary {
    cursor: pointer;
    font-weight: 700;
}

ul.toc {
    list-style: none;
    padding-left: 0;
}

ul.toc li {
    margin: 6px 0;
}

a {
    color: #8ab4ff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

code {
    background: #222;
    padding: 2px 6px;
    border-radius: 6px;
}

/* 유틸리티 클래스 */
.center { text-align: center; }
.space-top { margin-top: 14px; }
.note { color: var(--muted); font-size: 13px; }

/* 애니메이션 */
@keyframes spin { 
    0% { transform: rotate(0deg); } 
    100% { transform: rotate(360deg); } 
}

/* Inline renew checkout: slide-in animation */
#spa-slot .inline-checkout.slide-in {
	max-height: 0;
	opacity: 0;
	overflow: hidden;
	transition: max-height .4s ease, opacity .3s ease;
}
#spa-slot .inline-checkout.slide-in.show {
	max-height: 1200px;	/* enough for iframe height */
	opacity: 1;
}
