/*
    Hestia's Blueprint for the Proving Grounds (Ver. 2.0)
    -------------------------------------------------------
    File: exam.css
    Role: To create a fair, focused, and engaging environment for the entrance examination.
*/
/*
    Hestia's Blueprint for the Proving Grounds (Ver. 2.0)
    -------------------------------------------------------
    File: exam.css
    Role: To create a fair, focused, and engaging environment for the entrance examination.
*/

/* --- [I] Hero Section for Exam --- */
.hero-project.hero-exam {
    padding: 5rem 2rem;
    text-align: center;
    color: white;
    background: linear-gradient(45deg, rgba(0, 50, 100, 0.8), rgba(0, 20, 50, 0.7)), url('/images/backgrounds/digital_grid.png');
    background-size: cover;
    border-bottom: 5px solid var(--color-secondary);
}
.hero-exam .project-title {
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    margin: 0;
}
.hero-exam .project-catchcopy {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-top: 0.5rem;
}


/* --- [II] Introduction Section --- */
.exam-section.exam-intro .container {
    max-width: 900px;
}

/* legal.css からのデザインを継承・調整 */
.legal-preface.with-guide {
    display: flex;
    align-items: center;
    gap: 2rem;
    background-color: #f8f9fa;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 3rem;
}
.guide-character img {
    height: 100px;
    flex-shrink: 0;
}
.guide-text h3 {
    font-family: var(--font-family-title);
    color: var(--color-primary);
    margin: 0 0 0.5rem 0;
}
.guide-text p {
    margin: 0;
    line-height: 1.8;
}

/* スマートフォン表示用の調整 */
@media (max-width: 768px) {
    .legal-preface.with-guide {
        flex-direction: column;
        text-align: center;
    }
}


.hero-exam {
    background: linear-gradient(45deg, rgba(0, 50, 100, 0.8), rgba(0, 20, 50, 0.7)), url('/images/backgrounds/digital_grid.png'); /* 仮の背景 */
}

.exam-section {
    padding: 4rem 0 5rem 0;
}

.exam-form {
    max-width: 800px;
    margin: 2rem auto 0;
    background-color: transparent; /* 背景はfieldsetで制御 */
    padding: 0;
    border: none;
}

/* --- Fieldset: 魂の器 --- */
.form-fieldset {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 2.5rem 3rem;
    margin-bottom: 2.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(0, 90, 158, 0.05);
}

.form-fieldset legend {
    font-family: var(--font-family-title);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    padding: 0 1rem;
    margin-left: -1rem; /* for alignment */
    background-color: #fff;
}

/* --- Form Group & Inputs --- */
.form-group {
    margin-bottom: 1.8rem;
}
.form-group:last-child {
    margin-bottom: 0.5rem;
}

.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.8rem;
    color: #333;
}
.form-group .instruction {
    font-weight: normal;
    font-size: 0.9rem;
    color: #777;
    margin-left: 0.5em;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="date"],
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    font-family: var(--font-family-base);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 90, 158, 0.15);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* --- Radio & Checkbox Groups --- */
.radio-group, .checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
}
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.radio-group label,
.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5em;
    cursor: pointer;
    font-weight: normal;
}

/* --- Badges & Actions --- */
.optional-badge {
    display: inline-block;
    background-color: #6c757d;
    color: white;
    font-size: 0.7rem;
    padding: 0.2em 0.5em;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 0.5em;
}

.form-actions {
    text-align: center;
    margin-top: 1rem;
}

/*
    Hestia's Blueprint Addition (Ver. 2.1)
    -------------------------------------------
    File: exam.css (Addition)
    Role: To create a seamless visual flow from the hero section to the form.
*/

/* --- Hero Section & Intro Section Integration --- */

/* ヒーローセクションの下部に余白を持たせる */
.hero-exam {
    padding-bottom: 8rem; 
}

/* 導入セクション（コレクトの案内とフォーム）全体 */
.exam-intro {
    padding-top: 0;
    margin-top: -8rem; /* ヒーローセクションにめり込ませる */
}

/* 導入セクション内のコンテナ */
.exam-intro .container {
    position: relative; /* z-indexを効かせるため */
    z-index: 2;
}
/* --- [IV] Loading & Preparation Page --- */
.loading-container {
    max-width: 600px;
    margin: 3rem auto;
    padding: 3rem;
    background-color: #fff;
    border-radius: 12px;
}
.loading-container .loading-hud {
    /* style.css のローディングアニメーションを再利用 */
    margin: 0 auto 2rem auto;
}
.loading-container h2 {
    font-family: var(--font-family-title);
    margin-bottom: 1rem;
}
.loading-container p {
    line-height: 1.8;
    color: #555;
}
/* --- [V] Test Area & Timer --- */
.exam-header-bar {
    background-color: #fff;
    padding: 1rem 0;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 61px; /* ヘッダーの高さに合わせる */
    z-index: 900;
}
.exam-header-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.exam-header-bar h1 {
    font-size: 1.2rem;
    margin: 0;
}
#timer {
    font-family: var(--font-family-title);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
}

.exam-test-area .container {
    max-width: 900px;
}

.exam-guide-dialogue {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 3rem;
}
.exam-guide-dialogue img {
    height: 60px;
}
.exam-guide-dialogue p {
    margin: 0;
}

/* --- Question Block --- */
.question-block {
    background-color: #fff;
    padding: 2rem 2.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid #e0e0e0;
}

.question-title {
    font-size: 1.2rem;
    line-height: 1.7;
    margin: 0 0 1.5rem 0;
}
.q-number {
    display: inline-block;
    background-color: var(--color-primary);
    color: white;
    font-family: var(--font-family-title);
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    margin-right: 0.8rem;
    font-size: 1rem;
}

.question-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.question-options label {
    display: block;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;
}
.question-options label:hover {
    background-color: #f0f8ff;
    border-color: var(--color-primary);
}
.question-options input[type="radio"] {
    margin-right: 0.8em;
}

/* 選択された選択肢のスタイル */
.question-options input[type="radio"]:checked + span {
    font-weight: 700;
}

/* --- [VI] Result Page --- */
.exam-result-area .container {
    max-width: 800px;
}

.result-dialogue {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 3rem;
}
.result-dialogue img {
    height: 80px;
}
.result-dialogue p {
    margin: 0;
    line-height: 1.8;
}

.result-summary {
    background-color: #fff;
    border-radius: 12px;
    padding: 2.5rem 3rem;
    text-align: center;
    border: 1px solid #e0e0e0;
}
.result-summary h2 {
    font-family: var(--font-family-title);
}
.applicant-info {
    line-height: 1.7;
    margin-bottom: 2rem;
}

.final-result {
    font-family: var(--font-family-title);
    font-size: 3.5rem;
    font-weight: 700;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}
.final-result.passed {
    color: #d32f2f; /* A glorious red */
    background-color: #ffebee;
    border: 2px dashed #d32f2f;
}
.final-result.failed {
    color: #0277bd; /* A calm blue */
    background-color: #e1f5fe;
    border: 2px dashed #0277bd;
}

.score-info {
    font-size: 1.2rem;
    margin-bottom: 2.5rem;
}
.result-actions a {
    background-color: #6c757d;
}
.result-actions a:hover {
    background-color: #5a6268;
}

/* --- Next Step Gate for Passers --- */
.next-step-gate {
    margin-top: 3rem;
    padding: 2.5rem;
    border: 2px solid var(--color-secondary);
    background-color: #fff9f0;
    border-radius: 12px;
    text-align: center;
}
.next-step-gate h3 {
    font-family: var(--font-family-title);
    font-size: 1.8rem;
    color: var(--color-primary);
}
.next-step-gate p {
    line-height: 1.8;
}
.discord-invite {
    margin-top: 2rem;
}
.cta-button.discord {
    background-color: #5865F2; /* Discord brand color */
}
.cta-button.discord:hover {
    background-color: #4f5bda;
}
.invite-note {
    font-size: 0.9rem;
    color: #777;
    margin-top: 1rem;
}