/* ========================================
   圧縮試験依頼ページ専用CSS
   test-request.html
   ======================================== */

/* ================================================
   フォームコンテナの幅を拡大
   ================================================ */

.contact-form-container {
    max-width: 1100px;
}

/* ================================================
   タブスタイル
   ================================================ */

.form-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 0;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
}

.tab-button {
    flex: 0 1 auto;
    padding: 8px 16px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
}

.tab-button:hover {
    background: #e8f4fc;
    color: #0068b7;
    border-color: #0068b7;
}

.tab-button.active {
    background: #0068b7;
    color: #fff;
    border-color: #0068b7;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ================================================
   2カラムフォームレイアウト
   ================================================ */

/* ラジオボタンを含む行は中央揃え */
.form-row:has(.form-row-inline) {
    align-items: center;
}

/* ラジオボタンを含む行のラベルはpadding不要 */
.form-row:has(.form-row-inline) .form-label {
    padding-top: 0;
}

/* form-common.cssの.form-inputにtest-request固有のセレクタを追加 */
.form-row-2col .form-input {
    padding: 12px 16px !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
    height: auto !important;
    min-height: 48px !important;
    box-sizing: border-box !important;
}

/* 2カラムフォームのセレクトボックス */
.form-row-2col select.form-select {
    color: #000 !important;
    background-color: #ffffff !important;
    font-size: 16px !important;
    padding: 12px 16px !important;
    line-height: 1.5 !important;
    height: auto !important;
    min-height: 48px !important;
    box-sizing: border-box !important;
    -webkit-text-fill-color: #000 !important;
    -webkit-appearance: menulist !important;
    -moz-appearance: menulist !important;
    appearance: menulist !important;
    font-family: "Zen Kaku Gothic New", sans-serif !important;
}

.form-row-2col select.form-select option {
    color: #000 !important;
    background-color: #fff !important;
    padding: 8px !important;
    font-size: 16px !important;
}

select.form-select:disabled option,
select.form-select option:disabled {
    color: #999 !important;
}

.form-row-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.form-row-2col .form-col {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 15px;
    align-items: center;
}

.form-row-2col .form-label {
    text-align: right;
}

/* ================================================
   インラインフォーム要素（ラジオボタン）
   ================================================ */

.form-row-inline {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ラジオボタンのサイズ調整（common.cssのscale(2)を上書き） */
.form-row-inline input[type="radio"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    -webkit-transform: scale(1) !important;
    transform: scale(1) !important;
    margin: 0 5px 0 0 !important;
}

/* ================================================
   チェックボックス（test-request固有）
   ================================================ */

.checkbox-same-as {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 15px;
}

.checkbox-same-as input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    -webkit-transform: scale(1) !important;
    transform: scale(1) !important;
    margin: 0 5px 0 0 !important;
}

.checkbox-same-as span {
    user-select: none;
}

.checkbox-same-as a {
    padding-right: 10px;
}

@media (max-width: 768px) {
    .checkbox-same-as {
        font-size: small;
    }
}

/* ================================================
   フィールド非活性時のスタイル
   ================================================ */

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
    background-color: #f5f5f5 !important;
    color: #666 !important;
    cursor: not-allowed !important;
    opacity: 0.7;
}

/* ================================================
   フォームセクションタイトル・注意書き
   ================================================ */

.form-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #0068b7;
    margin: 30px 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0068b7;
}

.form-note {
    font-size: 14px;
    color: #666;
    margin: 10px 0;
    padding-left: 10px;
    border-left: 3px solid #0068b7;
}

.form-notice {
    text-align: center;
    padding: 20px 0;
    font-size: clamp(0.75rem, 0.5rem + 0.8vw, 0.875rem);
    line-height: 1.8;
    color: #333;
}

/* 改行制御用 - 意味のまとまりで改行 */
.form-notice .nowrap-line {
    display: inline-block;
    white-space: nowrap;
}

.form-notice .notice-note,
.notice-note {
    display: block;
    margin-top: 3px;
    color: #d9534f;
    font-size: clamp(0.7rem, 0.45rem + 0.8vw, 0.8125rem);
}

/* 注意事項の改行制御 */
.form-notice .notice-note .nowrap-line {
    display: inline-block;
    white-space: nowrap;
}

.required-notice {
    text-align: left;
    margin-bottom: 20px;
    font-size: 13px;
    color: #666;
}

/* ================================================
   メール・FAXでのご依頼案内
   ================================================ */

.form-alternative-notice {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px 25px;
    margin-bottom: 20px;
    text-align: center;
}

.form-alternative-notice .alternative-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 12px;
}

.form-alternative-notice .alternative-title i {
    margin-right: 8px;
    color: #0068b7;
}

.form-alternative-notice .alternative-text {
    font-size: clamp(0.75rem, 0.5rem + 0.8vw, 0.875rem);
    line-height: 1.8;
    color: #555;
    margin-bottom: 15px;
}

/* 改行制御用 */
.form-alternative-notice .alternative-text .nowrap-line {
    display: inline-block;
    white-space: nowrap;
}

.form-alternative-notice .alternative-text a {
    color: #0068b7;
    text-decoration: underline;
}

.form-alternative-notice .alternative-text a:hover {
    color: #004a82;
}

.form-alternative-notice .alternative-form-guide {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #ccc;
    font-size: 14px;
    color: #333;
}

.form-alternative-notice .alternative-form-guide i {
    margin-right: 8px;
    color: #0068b7;
}

.download-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.download-btn i {
    margin-right: 8px;
    font-size: 16px;
}

.download-btn-excel {
    background-color: #217346;
    color: #fff;
}

.download-btn-excel:hover {
    background-color: #1a5c38;
    color: #fff;
}

.download-btn-pdf {
    background-color: #dc3545;
    color: #fff;
}

.download-btn-pdf:hover {
    background-color: #b02a37;
    color: #fff;
}

@media (max-width: 480px) {
    .download-links {
        flex-direction: column;
        align-items: center;
    }

    .download-btn {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
}

/* ================================================
   条件付き入力フィールド
   ================================================ */

.conditional-input {
    display: none;
    flex: 1;
}

.conditional-input.show {
    display: block;
}

/* 条件付き入力欄のラッパーもflex: 1を持つ */
.orderer-row .form-input-wrapper,
.naming-row .form-input-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.orderer-row .form-input-wrapper .conditional-input,
.naming-row .form-input-wrapper .conditional-input {
    width: 100%;
}

/* ================================================
   発注者フィールドの横並びレイアウト
   ================================================ */

.orderer-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.orderer-row .form-select {
    flex: 0 0 auto;
    width: 200px;
}

/* ================================================
   呼び方フィールド用スタイル
   ================================================ */

.naming-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.naming-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.naming-textboxes {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    max-width: 100%;
}

.naming-textboxes input {
    flex: 1 1 0;
    min-width: 0;
    max-width: calc(33.333% - 7px);
}

.naming-textboxes span {
    color: #666;
    flex: 0 0 auto;
}

/* ================================================
   供試体テーブル
   ================================================ */

.specimen-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
}

.specimen-table th,
.specimen-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
}

.specimen-table th {
    background: #0068b7;
    color: white;
    font-weight: 600;
}

.specimen-table input[type="text"],
.specimen-table input[type="number"],
.specimen-table input[type="date"] {
    width: 100%;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

/* テーブル内の入力フィールドラッパー（エラーメッセージ用） */
.specimen-table td {
    position: relative;
}

.specimen-table .form-input-wrapper {
    position: relative;
    width: 100%;
}

/* テーブル内のエラーメッセージは絶対位置で表示 */
.specimen-table .error-message {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 10;
    background: #fff;
    padding: 4px 8px;
    margin-top: 2px;
    border: 1px solid #dc3545;
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    white-space: nowrap;
    font-size: 12px;
}

/* ================================================
   確認画面モーダル
   ================================================ */

.confirmation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
}

.confirmation-modal {
    background: #fff;
    border-radius: 8px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.confirmation-header {
    padding: 30px 30px 20px;
    border-bottom: 2px solid #0068b7;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.confirmation-header h2 {
    margin: 0 0 10px;
    font-size: 24px;
    font-weight: 700;
    color: #0068b7;
}

.confirmation-note {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.confirmation-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.confirmation-section {
    margin-bottom: 30px;
}

.confirmation-section:last-child {
    margin-bottom: 0;
}

.confirmation-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #0068b7;
    margin: 0 0 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #0068b7;
}

.confirmation-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

.confirmation-row:last-child {
    border-bottom: none;
}

.confirmation-label {
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: flex-start;
}

.confirmation-value {
    color: #555;
    word-break: break-word;
    white-space: pre-wrap;
}

.confirmation-value.same-as-text {
    font-weight: 700;
    color: #333;
}

/* 供試体詳細データ用テーブル（contact.cssの.confirmation-tableを上書き） */
table.confirmation-table {
    display: table;
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 14px;
}

table.confirmation-table th,
table.confirmation-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

table.confirmation-table th {
    background-color: #0068b7;
    font-weight: 600;
    color: #fff;
}

table.confirmation-table td {
    background-color: #fff;
}

.confirmation-actions {
    padding: 20px 30px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    gap: 15px;
    background: #f8f9fa;
}

/* test-request固有のモーダルボタン（contact.cssと別スタイル） */
.confirmation-actions .btn-back,
.confirmation-actions .btn-submit {
    flex: 1;
    padding: 15px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.confirmation-actions .btn-back {
    background: #6c757d;
    color: #fff;
}

.confirmation-actions .btn-back:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.confirmation-actions .btn-submit {
    background: #0068b7;
    color: #fff;
}

.confirmation-actions .btn-submit:hover {
    background: #005a9e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 104, 183, 0.3);
}

/* ================================================
   デモ注記
   ================================================ */

.demo-note {
    text-align: center;
    font-size: 12px;
    color: #999;
    margin-top: 10px;
}

/* ================================================
   送信完了モーダル
   ================================================ */

.completion-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.completion-modal {
    background: white;
    border-radius: 12px;
    padding: 60px 40px;
    max-width: 600px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: completionFadeIn 0.5s ease;
}

.completion-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: checkmarkPop 0.6s ease;
}

.completion-icon svg {
    width: 50px;
    height: 50px;
    stroke: white;
    stroke-width: 3;
}

.completion-title {
    font-size: 28px;
    color: #333;
    margin-bottom: 20px;
    font-weight: 700;
}

.completion-message {
    color: #666;
    line-height: 1.8;
    margin-bottom: 30px;
}

.completion-message p {
    margin-bottom: 10px;
}

.completion-note {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-left: 4px solid #0068b7;
    border-radius: 4px;
}

.completion-reference {
    background: #e9ecef;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 30px;
    font-size: 14px;
    color: #495057;
}

.completion-reference span {
    font-weight: 600;
    color: #0068b7;
}

.completion-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-reset,
.btn-home {
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-reset {
    background: white;
    border: 2px solid #0068b7;
    color: #0068b7;
}

.btn-reset:hover {
    background: #f0f8ff;
}

.btn-home {
    background: #0068b7;
    border: 2px solid #0068b7;
    color: white;
}

.btn-home:hover {
    background: #005299;
    border-color: #005299;
}

@keyframes completionFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes checkmarkPop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* ボタンが1つだけの場合 */
.btn-home-single {
    min-width: 250px;
}

/* ================================================
   レスポンシブ（test-request固有）
   ================================================ */

@media (max-width: 768px) {
    .form-tabs {
        flex-direction: column;
    }

    .tab-button {
        width: 100%;
    }

    .form-row-2col {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .form-row-2col .form-label {
        text-align: left;
        padding-top: 0;
    }

    .form-row-2col .form-col {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .orderer-row {
        flex-direction: column;
        align-items: stretch;
    }

    .orderer-row .form-select {
        width: 100%;
    }

    .conditional-input {
        margin-top: 10px;
    }

    .naming-row {
        flex-direction: column;
        align-items: stretch;
    }

    .naming-textboxes {
        flex-wrap: wrap;
    }

    .naming-textboxes input {
        width: 80px;
    }

    .specimen-table {
        font-size: 12px;
    }

    .specimen-table th,
    .specimen-table td {
        padding: 5px;
    }

    /* 確認モーダル */
    .confirmation-modal {
        max-height: 95vh;
    }

    .confirmation-header {
        padding: 20px;
    }

    .confirmation-header h2 {
        font-size: 20px;
    }

    .confirmation-content {
        padding: 20px;
    }

    .confirmation-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .confirmation-label {
        font-size: 14px;
    }

    .confirmation-value {
        font-size: 14px;
    }

    .confirmation-actions {
        flex-direction: column;
        padding: 15px;
    }

    .confirmation-actions .btn-back,
    .confirmation-actions .btn-submit {
        padding: 12px 20px;
        font-size: 14px;
    }

    /* 送信完了モーダル */
    .completion-modal {
        padding: 40px 20px;
    }

    .completion-title {
        font-size: 24px;
    }

    .completion-actions {
        flex-direction: column;
    }

    .btn-reset,
    .btn-home {
        width: 100%;
    }

    .btn-home-single {
        min-width: auto;
        width: 100%;
    }
}

/* ================================================
   鉄筋コンクリート用棒鋼引張試験依頼
   ================================================ */

.rebar-request-container {
    padding: 40px 20px;
}

.rebar-request-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 50px 40px;
}

.rebar-request-icon {
    font-size: 48px;
    color: #0068b7;
    margin-bottom: 20px;
}

.rebar-request-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
}

.rebar-request-text {
    font-size: 15px;
    line-height: 2;
    color: #555;
    margin-bottom: 30px;
}

.rebar-request-content .download-links {
    margin-bottom: 30px;
}

.download-btn-large {
    padding: 15px 30px;
    font-size: 16px;
}

.rebar-contact-info {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.rebar-contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    color: #333;
}

.rebar-contact-item i {
    color: #0068b7;
    font-size: 18px;
}

.rebar-contact-item a {
    color: #0068b7;
    text-decoration: underline;
}

.rebar-contact-item a:hover {
    color: #004a82;
}

.rebar-request-note {
    margin-top: 20px;
}

/* タブ3つ対応のレスポンシブ */
@media (max-width: 768px) {
    .form-tabs {
        flex-direction: column;
        gap: 5px;
    }

    .tab-button {
        padding: 10px 12px;
        font-size: 12px;
        text-align: center;
    }

    .rebar-request-content {
        padding: 30px 20px;
    }

    .rebar-request-title {
        font-size: 20px;
    }

    .rebar-request-text {
        font-size: 14px;
    }

    .rebar-contact-info {
        flex-direction: column;
        gap: 15px;
    }

    .download-btn-large {
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* ================================================
   統合タブナビゲーションセクション
   ================================================ */

.tabs-navigation-section {
    padding-bottom: 0 !important;
}

.tabs-navigation-section .contact-form-container {
    padding-bottom: 0;
}

/* コンテンツエリアセクション */
.content-area-section {
    padding-top: 0 !important;
}

.content-area-section .contact-form-container {
    padding-top: 30px;
}

/* ================================================
   タブ案内テキスト
   ================================================ */

.tabs-guide-text {
    font-size: 14px;
    color: #555;
    margin-bottom: 15px;
    text-align: center;
}

/* ================================================
   セクションカテゴリヘッダー（案A：シンプルラベル）
   ================================================ */

.section-category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0 8px 12px;
    border-left: 4px solid #0068b7;
    background: transparent;
    color: #333;
    margin-bottom: 8px;
}

.section-category-header i {
    font-size: 14px;
    color: #0068b7;
}

.section-category-title {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ================================================
   プラント様向けセクション
   ================================================ */

.section-category-plant {
    border-left-color: #2e7d32;
    margin-top: 15px;
}

.section-category-plant i {
    color: #2e7d32;
}

.form-tabs-plant {
    border-bottom-color: #c8e6c9;
    margin-bottom: 0;
}

.tab-button-plant {
    max-width: 200px;
}

.tab-button-plant:hover {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #2e7d32;
}

.tab-button-plant.active {
    background: #2e7d32;
    color: #fff;
    border-color: #2e7d32;
}

/* 試験体運搬依頼コンテナ */
.transport-request-container {
    border-color: #2e7d32;
}

.transport-request-icon {
    background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%) !important;
}

/* ダウンロードボタン（プラント様向け） */
.download-btn-plant {
    background-color: #2e7d32;
}

.download-btn-plant:hover {
    background-color: #1b5e20;
}

/* ================================================
   レスポンシブ対応
   ================================================ */

@media (max-width: 768px) {
    .section-category-header {
        padding: 6px 0 6px 10px;
    }

    .section-category-title {
        font-size: 13px;
    }

    .section-category-plant {
        margin-top: 12px;
    }

    .tab-button-plant {
        max-width: 100%;
    }
}
