/* 인증/대시보드 공통 스타일 */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1E3A8A;
    --primary-light: #3B82F6;
    --primary-hover: #15306E;
    --bg: #F8FAFC;
    --text: #1E293B;
    --text-muted: #64748B;
    --surface: #FFFFFF;
    --border: #E2E8F0;
    --success: #059669;
    --error: #DC2626;
    --warning: #D97706;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* 네비게이션 */
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1080px;
    margin: 0 auto;
    padding: 20px 24px;
    width: 100%;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.25rem;
}

.nav-logo img {
    width: 28px;
    height: 28px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-user {
    font-size: 0.9rem;
    color: var(--text-muted);
}

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

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

/* 인증 컨테이너 */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
    padding: 24px;
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 32px;
}

/* 탭 전환 */
.auth-tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-muted);
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.auth-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.auth-tab:hover:not(.active) {
    color: var(--text);
}

/* 폼 */
.auth-form {
    display: none;
}

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

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-input:focus {
    border-color: var(--primary-light);
}

.form-input.error {
    border-color: var(--error);
}

.form-error {
    display: none;
    color: var(--error);
    font-size: 0.8rem;
    margin-top: 6px;
}

.form-error.show {
    display: block;
}

/* 버튼 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    width: 100%;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1.5px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary-light);
    color: var(--primary);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-outline-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    width: auto;
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.btn-outline-sm:hover {
    background: var(--primary);
    color: #fff;
}

/* 소셜 로그인 */
.social-divider {
    display: flex;
    align-items: center;
    margin: 28px 0 20px;
    gap: 12px;
}

.social-divider::before,
.social-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.social-divider span {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.social-buttons {
    display: flex;
    gap: 10px;
}

.btn-social {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 0;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    font-family: inherit;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text);
}

.btn-social:hover {
    opacity: 0.85;
}

.btn-social:active {
    transform: scale(0.98);
}

.btn-google {
    background: #fff;
    border-color: #dadce0;
}

.btn-kakao {
    background: #FEE500;
    border-color: #FEE500;
    color: #191919;
}

.btn-naver {
    background: #03C75A;
    border-color: #03C75A;
    color: #fff;
}

/* 대시보드 */
.dashboard {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px 40px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: nowrap;
    gap: 16px;
}

.dashboard-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* 변환 이력 */
.history-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.history-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.history-empty {
    padding: 48px 24px;
    text-align: center;
    color: var(--text-muted);
}

.history-list {
    list-style: none;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
}

.history-item:last-child {
    border-bottom: none;
}

.history-filename {
    font-weight: 600;
    font-size: 0.95rem;
}

.history-meta {
    display: flex;
    gap: 16px;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-done {
    background: #ECFDF5;
    color: var(--success);
}

.status-pending {
    background: #FEF3C7;
    color: var(--warning);
}

.status-processing {
    background: #EFF6FF;
    color: var(--primary-light);
}

.status-failed {
    background: #FEF2F2;
    color: var(--error);
}

/* 정적 페이지 */
.static-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

.static-page h1 {
    font-size: 1.75rem;
    margin-bottom: 24px;
}

.static-page h2 {
    font-size: 1.25rem;
    margin-top: 32px;
    margin-bottom: 12px;
}

.static-page p {
    color: var(--text-muted);
    margin-bottom: 16px;
}

.static-page ul {
    padding-left: 24px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.static-page li {
    margin-bottom: 8px;
}

/* 에러 페이지 */
.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
    text-align: center;
    padding: 24px;
}

.error-code {
    font-size: 6rem;
    font-weight: 800;
    color: var(--border);
    line-height: 1;
}

.error-message {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin: 16px 0 32px;
}

/* 푸터 */
.footer {
    border-top: 1px solid var(--border);
    padding: 24px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer a {
    color: var(--text-muted);
    text-decoration: none;
}

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

/* ==================== Point Card ==================== */
.point-card {
    position: relative;
    background: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 100%);
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 24px;
    color: white;
    overflow: hidden;
}

.point-card-deco {
    position: absolute;
    top: -40px;
    right: -40px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    pointer-events: none;
}

.point-card-deco::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: -80px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}

.point-card-content {
    position: relative;
    z-index: 1;
}

.point-card-top {
    margin-bottom: 10px;
}

.point-plan-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.point-card-main {
    margin-bottom: 10px;
}

.point-remaining {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.point-number {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
}

.point-unit {
    font-size: 1rem;
    opacity: 0.85;
    font-weight: 500;
}

.point-usage-bar {
    height: 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.point-usage-fill {
    height: 100%;
    background: white;
    border-radius: 3px;
    transition: width 0.5s;
}

.point-usage-text {
    font-size: 0.8rem;
    opacity: 0.75;
    margin-bottom: 10px;
}

.point-buy-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 8px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
    width: auto;
}

.point-buy-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* ==================== 4-Column Stats Grid ==================== */
.stats-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stats-grid-4 .stat-card {
    position: relative;
    padding-top: 40px;
}

.stat-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon-primary {
    background: #EFF6FF;
    color: var(--primary);
}

.stat-icon-success {
    background: #ECFDF5;
    color: var(--success);
}

.stat-icon-warning {
    background: #FEF3C7;
    color: var(--warning);
}

.stat-icon-muted {
    background: #F3F4F6;
    color: var(--text-muted);
}

.stat-value-small {
    font-size: 1.1rem;
}

/* 반응형 */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .auth-card {
        padding: 24px;
    }

    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

}
