/* ---------------------------------------------------- */
/* 0. :ROOT 변수 (모든 페이지 공통)                     */
/* ---------------------------------------------------- */
:root {
    --primary-color: #A0CECB;
    --primary-hover: #9bb3b1;
    --text-color-base: #ffffff;
    --border-color-base: #444;
    --shadow-color-base: rgba(160, 206, 203, 0.05);
    --error-color-base: #ff6b6b;
    --success-color-base: #51cf66;
    --light-text-base: #aaa;
    --radius-base: 8px;
    --transition-base: all 0.3s ease;
}

/* ---------------------------------------------------- */
/* 1. 페이지 콘텐츠 공통 스타일                         */
/* ---------------------------------------------------- */

/* 페이지 콘텐츠를 위한 기본 컨테이너 */
.page-content-container {
    padding-top: 1rem;
}

/* 페이지 헤더 공통 스타일 */
.page-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.page-header h1 {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.page-header p {
    color: var(--light-text-base);
    font-size: 1rem;
}

/* 카드 스타일 (공통) */
.card {
    background-color: #1a1a1a;
    border-radius: var(--radius-base);
    box-shadow: 0 10px 30px var(--shadow-color-base);
    padding: 2rem;
    margin-bottom: 2rem;
}

/* 섹션 스타일 (공통) */
.section {
    margin-bottom: 2rem;
    position: relative;
}

.section:last-child {
    margin-bottom: 0;
}

.section-title {
    display: flex;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1.2rem;
}

.section-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background-color: var(--primary-color);
    color: #000;
    border-radius: 50%;
    font-size: 0.9rem;
    margin-right: 0.8rem;
}

/* 폼 그룹 및 입력 요소 공통 스타일 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.input-group {
    display: flex;
    flex-direction: column;
}

label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

/* 라디오 버튼 공통 스타일 */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.radio-button {
    position: relative;
    cursor: pointer;
}

.radio-button input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.radio-button label {
    /* 라디오 버튼 자체의 레이블 */
    display: block;
    padding: 0.8rem 1.5rem;
    border: 2px solid var(--border-color-base);
    border-radius: var(--radius-base);
    font-weight: 500;
    transition: var(--transition-base);
    text-align: center;
    min-width: 140px;
    color: var(--text-color-base);
    background-color: #2a2a2a;
}

.radio-button input[type="radio"]:checked+label {
    border-color: var(--primary-color);
    background-color: rgba(160, 206, 203, 0.15);
    color: var(--primary-color);
}

.radio-label {
    cursor: pointer;
}

/* 텍스트 입력 필드 공통 스타일 */
textarea,
input[type="text"],
input[type="number"] {
    padding: 0.9rem 1rem;
    border: 2px solid var(--border-color-base);
    border-radius: var(--radius-base);
    font-size: 1rem;
    transition: var(--transition-base);
    width: 100%;
    font-family: inherit;
    /* body 폰트 상속 */
    background-color: #2a2a2a;
    color: var(--text-color-base);
    box-sizing: border-box;
}

textarea::placeholder,
input[type="text"]::placeholder,
input[type="number"]::placeholder {
    color: var(--light-text-base);
}

textarea {
    min-height: 150px;
    resize: vertical;
}

input[type="number"] {
    width: auto;
    min-width: 100px;
}


textarea:focus,
input[type="text"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(160, 206, 203, 0.25);
}

/* 버튼 공통 스타일 */
.btn {
    display: inline-block;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: var(--radius-base);
    cursor: pointer;
    transition: var(--transition-base);
    width: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(160, 206, 203, 0.2);
}

.btn-primary {
    background-color: var(--primary-color);
    color: #000;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--light-text-base);
    color: #000;
}

.btn-secondary:hover {
    background-color: #bbb;
}

/* 유틸리티 공통 스타일 */
.error-message {
    background-color: rgba(255, 107, 107, 0.1);
    color: var(--error-color-base);
    padding: 1rem;
    border-radius: var(--radius-base);
    border-left: 4px solid var(--error-color-base);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.helper-text {
    font-size: 0.85rem;
    color: var(--light-text-base);
    margin-top: 0.5rem;
    line-height: 1.4;
}

.warning-text-strong {
    font-size: 0.9rem;
    color: #ffa500;
    margin-top: 0.5rem;
    line-height: 1.4;
    font-weight: 500;
}

.input-area {
    margin-top: 1rem;
    transition: var(--transition-base);
    opacity: 1;
    height: auto;
    overflow: hidden;
}

.input-area.hidden {
    opacity: 0;
    height: 0;
    margin: 0;
}

.divider {
    height: 1px;
    background-color: var(--border-color-base);
    margin: 2rem 0;
}


/* ---------------------------------------------------- */
/* 2. 네비게이션 바 라이트 테마 오버라이드 (공통)          */
/*    (base.html의 Tailwind 클래스를 보완하거나 덮어씀)   */
/* ---------------------------------------------------- */
nav ul li a:hover {
    background-color: #333 !important;
    color: var(--primary-color) !important;
}

#mobile-menu ul a:hover {
    background-color: #333 !important;
    color: var(--primary-color) !important;
}

/* ---------------------------------------------------- */
/* 3. 활성화된 네비게이션 링크 스타일 (라이트 테마용 - 공통) */
/* ---------------------------------------------------- */
nav ul li a.nav-item-active {
    background-color: var(--primary-color) !important;
    color: #000 !important;
    font-weight: 600 !important;
}

nav ul li a.nav-item-active:hover {
    background-color: var(--primary-hover) !important;
}

nav a.custom-button-light.nav-item-active,
nav a[href*="email_verification"].nav-item-active {
    background-color: var(--primary-color) !important;
    color: #000 !important;
}

nav a.custom-button-light.nav-item-active:hover,
nav a[href*="email_verification"].nav-item-active:hover {
    background-color: var(--primary-hover) !important;
}

/* 모바일 활성 네비게이션 아이템 (공통) */
#mobile-menu ul li a.mobile-nav-item-active {
    background-color: var(--primary-color) !important;
    color: #000 !important;
    font-weight: 600 !important;
}

#mobile-menu ul li a.mobile-nav-item-active:hover {
    background-color: var(--primary-hover) !important;
}

#mobile-menu a[href*="email_verification"].mobile-nav-item-active {
    background-color: var(--primary-hover) !important;
    color: #000 !important;
    font-weight: 700 !important;
}


/* ---------------------------------------------------- */
/* 4. 반응형 (공통적인 부분)                            */
/* ---------------------------------------------------- */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 1.8rem;
    }

    .page-header p {
        font-size: 0.9rem;
    }

    .card {
        padding: 1.5rem;
    }

    .radio-group {
        flex-direction: column;
        gap: 0.5rem;
    }

    .radio-button label {
        min-width: auto;
        width: 100%;
        padding: 0.7rem 1rem;
    }
}

/* ---------------------------------------------------- */
/* 5. 결과 페이지                                         */
/* ---------------------------------------------------- */

/* 링크 스타일 */
.back-link {
    display: inline-block;
    padding: 10px 18px;
    background-color: #555;
    color: white;
    text-decoration: none;
    border-radius: var(--radius-base);
    font-size: 0.95em;
    transition: background-color 0.3s ease;
}

.back-link:hover {
    background-color: #666;
}

/* 결과 섹션 스타일 */
.results-section {
    margin-top: 30px;
    background-color: #1a1a1a;
    padding: 25px;
    border-radius: var(--radius-base);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 오류 메시지 스타일 */
.error-message {
    color: #ff6b6b;
    background-color: rgba(255, 107, 107, 0.1);
    border: 1px solid #ff6b6b;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: var(--radius-base);
    text-align: center;
}

td.metric-value {
    text-align: right;
}

table.result {
    border-collapse: collapse;
    width: 100%;
    margin-top: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    background-color: #1a1a1a;
    table-layout: auto;
}

table.result th,
table.result td {
    border: 1px solid #444;
    padding: 12px 15px;
    text-align: left;
    word-wrap: break-word;
    color: #ffffff;
}

table.result th {
    background-color: var(--primary-color);
    color: #000;
    font-weight: bold;
}

table.result tr {
    background-color: #2a2a2a;
}


.custom-textarea,
.custom-input[type="text"],
.custom-input[type="number"] {
    padding: 0.9rem 1rem;
    border: 2px solid var(--border-color-base);
    border-radius: var(--radius-base);
    font-size: 1rem;
    transition: var(--transition-base);
    width: 100%;
    font-family: inherit;
    background-color: #2a2a2a;
    color: var(--text-color-base);
    box-sizing: border-box;
}

.custom-textarea::placeholder,
.custom-input[type="text"]::placeholder,
.custom-input[type="number"]::placeholder {
    color: var(--light-text-base);
}

.custom-textarea {
    min-height: 150px;
    resize: vertical;
    margin-top: 10px;
}

.custom-input[type="number"] {
    width: auto;
    min-width: 100px;
}


.custom-textarea:focus,
.custom-input[type="text"]:focus,
.custom-input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(160, 206, 203, 0.25);
}

.table-description {
    font-size: 0.9em;
    color: #aaa;
    margin-top: 15px;
    line-height: 1.6;
    padding: 10px;
    background-color: #2a2a2a;
    border-left: 3px solid var(--primary-color);
}

.results-section {
    margin-top: 30px;
    border: 1px solid #444;
    padding: 20px;
    border-radius: 5px;
}

.pageLoadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.pageLoadingOverlay.active {
    display: flex !important;
    justify-content: center;
    align-items: center;
}

.pageLoadingOverlay .spinner-icon {
    font-size: 3rem;
    color: var(--primary-color);
}

.form-actions .btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.fa-spin {
    animation: fa-spin 1s infinite linear !important;
}

@keyframes fa-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}