/* ==========================================
   운결 WOONGYEOL - 프리미엄 운세 앱
   ========================================== */

/* 변수 */
:root {
    --bg: #0B1426;
    --bg-card: rgba(17, 29, 51, 0.85);
    --text: #FFFFFF;
    --text-sub: #8B9DC3;
    --text-muted: #5A6A8A;
    --gold: #C9A962;
    --gold-light: #E2C878;
    --gold-dark: #A68B4B;
    --border: rgba(255,255,255,0.08);
    --font-kr: 'Noto Sans KR', sans-serif;
    --font-en: 'Cormorant Garamond', serif;
}

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

body {
    font-family: var(--font-kr);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

/* 배경 애니메이션 */
.bg-animation {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    animation: float 18s infinite ease-in-out;
}

.orb-1 {
    width: 350px; height: 350px;
    background: radial-gradient(circle, var(--gold) 0%, transparent 70%);
    top: -80px; left: -80px;
}

.orb-2 {
    width: 280px; height: 280px;
    background: radial-gradient(circle, #4A6FA5 0%, transparent 70%);
    bottom: -60px; right: -60px;
    animation-delay: -6s;
}

.orb-3 {
    width: 180px; height: 180px;
    background: radial-gradient(circle, var(--gold-dark) 0%, transparent 70%);
    top: 45%; left: 50%;
    animation-delay: -12s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(25px, -25px) scale(1.03); }
    66% { transform: translate(-20px, 15px) scale(0.97); }
}

/* 헤더 */
.header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 60px;
    background: rgba(11, 20, 38, 0.92);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.header-inner {
    max-width: 1100px;
    height: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* 로고 */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-circle {
    position: relative;
    width: 28px; height: 28px;
}

.logo-ring {
    position: absolute;
    inset: 0;
    border: 2px solid var(--gold);
    border-radius: 50%;
    animation: pulse-ring 2.5s infinite;
}

.logo-dot {
    position: absolute;
    top: 50%; left: 50%;
    width: 10px; height: 10px;
    background: var(--gold);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 15px var(--gold);
    animation: pulse-dot 2.5s infinite;
}

@keyframes pulse-ring {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.5; }
}

@keyframes pulse-dot {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.15); }
}

.logo-text {
    font-family: var(--font-en);
    font-size: 17px;
    font-weight: 500;
    letter-spacing: 2.5px;
    color: var(--text);
}

/* 헤더 우측 */
.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.lang-switch {
    display: flex;
    background: rgba(255,255,255,0.05);
    border-radius: 6px;
    padding: 2px;
}

.lang-btn {
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s;
}

.lang-btn.active {
    background: var(--gold);
    color: var(--bg);
}

.login-btn {
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-sub);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
}

.login-btn:hover {
    color: var(--gold);
    border-color: var(--gold);
}

/* 메인 */
.main {
    position: relative;
    z-index: 1;
    max-width: 420px;
    margin: 0 auto;
    padding: 100px 20px 40px;
}

/* 히어로 */
.hero {
    text-align: center;
    margin-bottom: 36px;
}

.hero-title {
    font-size: 26px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--gold);
    margin-bottom: 14px;
}

.hero-desc {
    font-size: 13px;
    font-weight: 300;
    color: var(--text-sub);
    line-height: 1.75;
}

/* 폼 카드 */
.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px 22px;
    backdrop-filter: blur(10px);
}

#fortuneForm {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--gold);
}

.form-input {
    width: 100%;
    padding: 13px 14px;
    font-family: var(--font-kr);
    font-size: 14px;
    color: var(--text);
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    transition: 0.2s;
}

.form-input::placeholder { color: var(--text-muted); }

.form-input:focus {
    border-color: rgba(201, 169, 98, 0.5);
    box-shadow: 0 0 0 3px rgba(201, 169, 98, 0.08);
}

.form-hint {
    font-size: 10px;
    color: var(--text-muted);
}

/* 성별 버튼 */
.gender-btns {
    display: flex;
    gap: 10px;
}

.gender-btn {
    flex: 1;
    padding: 12px;
    font-family: var(--font-kr);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-sub);
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
}

.gender-btn:hover { border-color: var(--text-muted); }

.gender-btn.active {
    color: var(--bg);
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    border-color: transparent;
    font-weight: 600;
}

/* 제출 버튼 */
.submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    margin-top: 6px;
    font-family: var(--font-kr);
    font-size: 14px;
    font-weight: 600;
    color: var(--bg);
    background: linear-gradient(135deg, var(--gold-dark), var(--gold), var(--gold-light));
    background-size: 200% 200%;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.3s;
    animation: shimmer 3.5s ease infinite;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201, 169, 98, 0.3);
}

.submit-btn i {
    font-size: 16px;
    transition: 0.2s;
}

.submit-btn:hover i { transform: translateX(3px); }

/* 로딩 */
.submit-btn.loading { pointer-events: none; }
.submit-btn.loading span, .submit-btn.loading i { display: none; }
.submit-btn.loading::after {
    content: '';
    width: 18px; height: 18px;
    border: 2px solid var(--bg);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* 모달 */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.modal.active { opacity: 1; visibility: visible; }

.modal-bg {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
}

.modal-box {
    position: relative;
    width: 90%;
    max-width: 340px;
    background: #111D33;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px 22px;
    transform: translateY(15px);
    transition: 0.3s;
}

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

.modal-close {
    position: absolute;
    top: 14px; right: 14px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
}

.modal-close:hover { color: var(--text); }

.modal-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
}

.modal-desc {
    font-size: 12px;
    color: var(--text-sub);
    margin-bottom: 20px;
}

#loginForm {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#loginForm .submit-btn { margin-top: 8px; }

/* 푸터 */
.footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 20px;
}

.footer p {
    font-size: 11px;
    color: var(--text-muted);
}

/* 토스트 */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    background: #111D33;
    border: 1px solid var(--gold);
    border-radius: 10px;
    color: var(--text);
    font-size: 13px;
    z-index: 300;
    animation: toastIn 0.3s;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(15px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
