/* ===================================
   FROM - 공통 CSS
=================================== */
@import url('https://fonts.googleapis.com/css2?family=Jua&family=Hi+Melody&family=Gaegu:wght@400;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

/* ── FROM Design Tokens ── */
:root {
    --from-primary:   #6071E3;
    --from-primary-2: #4361EE;
    --from-bg:        #F4F5F9;
    --from-text:      #1A1A2E;
    --from-text-sub:  #7A7899;
    --from-card-shadow: 0 8px 32px rgba(67,97,238,.10);
    --from-card-border: 1px solid rgba(67,97,238,.08);
}

body {
    font-family: 'Jua', sans-serif;
    background: var(--from-bg);
    min-height: 100vh;
    color: var(--from-text);
}

/* 회원가입/로그인 페이지 전용 중앙정렬 + 배경 */
body.auth-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background:
        radial-gradient(circle at 15% 20%, rgba(59,130,246,0.20), transparent 22%),
        radial-gradient(circle at 85% 10%, rgba(96,165,250,0.24), transparent 20%),
        linear-gradient(180deg, #edf3ff 0%, #f8fbff 45%, #ffffff 100%);
    min-height: 100vh;
}

/* ===================================
   네비게이션
=================================== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 80px;
    height: 100px;
    background: white;
    border-bottom: 1px solid rgba(67,97,238,.10);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(67,97,238,.08);
}
.nav-logo a { display: flex; align-items: center; text-decoration: none; }
.nav-logo img { height: 80px; }
.logo-text { font-family: 'Hi Melody', cursive; font-size: 28px; color: #6071E3; font-style: italic; font-weight: 700; }
.nav-menu { display: flex; list-style: none; gap: 70px; }
.nav-menu a { text-decoration: none; color: #555; font-size: 20px; font-weight: 500; transition: color 0.2s; }
.nav-menu a:hover, .nav-menu a.active { color: #6071E3; font-weight: 700; }

/* ===================================
   버튼
=================================== */
.btn {
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    font-family: 'Jua', sans-serif;
}
.btn-primary {
    background: linear-gradient(135deg, #6071E3, #4361EE);
    color: white; font-weight: 700;
    box-shadow: 0 4px 16px rgba(67,97,238,.22);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #5B7CFA, #4361EE);
    box-shadow: 0 8px 24px rgba(67,97,238,.32);
    transform: translateY(-1px);
}
.btn-block { width: 100%; }
.btn-outline { background: white; color: #6071E3; border: 1.5px solid #6071E3; }
.btn-outline:hover { background: #f0f0ff; }
.btn-sm { padding: 10px 20px; font-size: 15px; border-radius: 20px; }
.btn-danger { background: #e74c3c; color: white; }

/* ===================================
   폼 공통
=================================== */
.form-container {
    max-width: 640px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 60px 80px;
    box-shadow: var(--from-card-shadow);
    border: var(--from-card-border);
}

/* ── 공통 카드 유틸리티 ── */
.from-card {
    background: white;
    border-radius: 20px;
    box-shadow: var(--from-card-shadow);
    border: var(--from-card-border);
}
.form-title {
    font-size: 26px;
    font-weight: 700;
    color: #6071E3;
    text-align: center;
    margin-bottom: 40px;
    font-family: 'Hi Melody', cursive;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.form-logo {
    height: 50px;
    width: auto;
    cursor: pointer;
    transition: transform 0.2s;
}
.form-logo:hover {
    transform: scale(1.05);
}
.form-group { margin-bottom: 24px; }
.form-group label { display: block; font-size: 16px; color: #666; margin-bottom: 8px; }
.form-control {
    width: 100%;
    padding: 14px 18px;
    border: 1.5px solid rgba(67,97,238,.18);
    border-radius: 8px;
    font-size: 16px;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    font-family: 'Jua', sans-serif;
}
.form-control:focus {
    border-color: var(--from-primary);
    box-shadow: 0 0 0 3px rgba(67,97,238,.10);
}
.form-row { display: flex; gap: 8px; align-items: flex-start; }
.form-row .form-control { flex: 1; }
.error-msg { color: #e74c3c; font-size: 14px; margin-top: 4px; display: block; min-height: 16px; }
.success-msg { color: #27ae60; font-size: 14px; margin-top: 4px; display: block; }

.form-footer { text-align: center; margin-top: 20px; font-size: 15px; color: #888; }
.form-footer a { color: #6071E3; text-decoration: none; font-weight: 600; }
.form-footer a:hover { text-decoration: underline; }

/* ===================================
   모달
=================================== */
.modal-overlay {
    display: none;
    position: fixed;
    top:0; left:0; right:0; bottom:0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
    justify-content: center;
    align-items: center;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: white;
    border-radius: 20px;
    padding: 32px 40px;
    text-align: center;
    min-width: 280px;
    box-shadow: 0 20px 60px rgba(67,97,238,.18);
    border: var(--from-card-border);
}
.modal-box p { font-size: 16px; color: #333; margin-bottom: 20px; line-height: 1.6; }
.modal-box .btn { min-width: 100px; }

/* ===================================
   페이지 공통
=================================== */
.page-container { max-width: 960px; margin: 0 auto; padding: 40px 20px; }
.page-header { font-size: 24px; font-weight: 700; color: #6071E3; margin-bottom: 24px; font-family: 'Hi Melody', cursive; }
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 60px !important;
    height: 64px !important;
    background: white;
    border-bottom: 1px solid #eee;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.main-logo { text-decoration: none; display: flex; align-items: center; }
.main-logo img { height: 44px !important; }
.main-nav { display: flex; align-items: center; gap: 40px !important; }
.main-nav a {
    color: #333 !important;
    text-decoration: none;
    font-size: 15px !important;
    font-weight: 500;
    transition: color 0.2s;
}
.main-nav a:hover { color: #6071E3 !important; font-weight: 700; }
.header-logout-btn {
    background: #6071E3 !important;
    border: none;
    color: white !important;
    padding: 8px 24px !important;
    border-radius: 30px !important;
    cursor: pointer;
    font-size: 13px !important;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
}
.header-logout-btn:hover { background: #4f5fd4 !important; transform: translateY(-2px); }