/* 変数定義 */
:root {
    --primary: #2b53ab;
    --primary-light: #dbeafe;
    --primary-dark: #1e40af;
    --bg-main: #f8fafc;
    --card-bg: #ffffff;
    --text-dark: #0f172a;
    --text-muted: #4a4c50;
    --border-soft: #e2e8f0;
    --accent-red: #ef4444;
}

/* 基本スタイル */
body {
    background: var(--bg-main);
    color: var(--text-dark);
    font-family: "Inter", -apple-system, sans-serif;
    padding: 80px 20px;
    margin: 0;
}

/* カードデザイン */
.registration-card {
    max-width: 720px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 50px 70px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    position: relative;
}

.registration-card::before,
.wide-container::before
 {
    content: "";
    position: absolute;
    top: -58px;
    left: 0;
    width: 421px;
    height: 45px;
    background-image: url('./images/logo_wide.png');
    background-size: contain;
    background-repeat: no-repeat;
}
@media (max-width: 768px) {
    .registration-card::before,
    .wide-container::before{
        top: -45px;
        width: 300px;
        height: 33px;
    }
}

.card-header {
    text-align: center;
    margin-bottom: 40px;
}

.card-header h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 10px;
    color: #3168b9;
}

/* セクションタイトル */
.section-title {
    font-size: 14px;
    font-weight: 700;
    color: #3168b9;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4em;
}

.section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-soft);
}

/* 入力要素・グループ */
.form-group {
    margin-bottom: 24px;
}

.badge-req {
    color: var(--accent-red);
    font-size: 10px;
    background: #fff1f2;
    padding: 2px 5px;
    border-radius: 4px;
    margin-left: 5px;
}

input,
select {
    width: 100%;
    padding: 20px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    font-size: 16px;
    transition: 0.2s;
    background: #fff;
    box-sizing: border-box;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

/* レイアウト（姓名・郵便番号） */
.flex-row {
    display: flex;
    gap: 15px;
    width: 100%;
}

.flex-row input {
    flex: 1;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.zip-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.zip-row input {
    width: 150px;
}

/* 規約同意エリア */
.bottom-area {
    margin-top: 40px;
}

.agreement-area {
    background: #f8fafc;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    margin-bottom: 30px;
}

.checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--primary);
}

.checkbox-item label {
    font-size: 14px;
    color: var(--text-dark);
    cursor: pointer;
    line-height: 1.5;
}

.policy-link {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 600;
}

/* 確認用テーブル */
.confirm-table {
    border-top: 1px solid var(--border-soft);
    margin-bottom: 40px;
}

.confirm-row {
    display: flex;
    padding: 18px 0;
    border-bottom: 1px solid var(--border-soft);
}

.confirm-label {
    width: 180px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
}

.confirm-value {
    flex: 1;
    font-size: 16px;
    font-weight: 500;
}

/* ボタン関連 */
.button-wrapper,
.button-group {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.submit-button {
    width: 100%;
    max-width: 320px;
    padding: 18px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2);
    transition: 0.3s;
}

.submit-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.submit-button:disabled {
    background: #cbd5e1;
    color: #f1f5f9;
    cursor: not-allowed;
    box-shadow: none;
    transform: none !important;
}

.back-button {
    background: none;
    border: 1px solid var(--border-soft);
    padding: 12px 40px;
    border-radius: 50px;
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 600;
}

/* フッター・ナビゲーション */
footer{
    text-align:center;
    margin-top: 6em;
    font-size: 0.8em;
}

.footer-nav {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-soft);
    text-align: center;
}

.footer-nav p {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

.primary-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    margin-left: 5px;
    transition: 0.2s;
    border-bottom: 1px solid transparent;
}

.primary-link:hover {
    color: var(--primary-dark);
    border-bottom: 1px solid var(--primary-dark);
}

/* 各種リンク・表示 */
.sub-link-area {
    text-align: right;
    margin-top: 8px;
}

.text-link {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
}

.text-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.error-banner {
    background: #fff1f2;
    color: var(--accent-red);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #fee2e2;
    margin-bottom: 25px;
    font-size: 14px;
    text-align: center;
    font-weight: 600;
}

.footer-nav .text-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

/* メディアクエリ（スマホ対応） */
@media (max-width: 600px) {
    .registration-card {
        padding: 30px 20px;
    }
    .flex-row {
        flex-direction: column;
    }
    .confirm-row {
        flex-direction: column;
    }
    .confirm-label {
        width: 100%;
        margin-bottom: 4px;
    }
}

@media (max-width: 480px) {
    .flex-row {
        flex-direction: column;
        gap: 10px;
    }
}






/* ユーザー_図面検索 */
.wide-container {
    max-width: 1100px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    position: relative;
}
@media (max-width: 600px) {
    .wide-container {
        padding: 10px;
    }
}
.page-header {
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-soft);
    padding-bottom: 20px;
}

/* --- 検索エリア（右寄せ・コンパクトボタン） --- */
.search-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 40px;
}

.search-card {
    background: #f8fafc;
    padding: 20px 25px;
    border-radius: 12px;
    border: 1px solid var(--border-soft);
}

.label {
    display: block;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--text-muted);
}

.search-container .label {
    font-weight: bold;
    color: #ff3a3a;
}

/* 検索エリアのレイアウト */
.search-row-align {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 1em;
}

.search-row-align:last-child {
    margin-bottom: 0;
}

.search-input-area {
    flex: 1; /* 入力欄やチップスのエリアを最大限広げる */
}

.input-field {
    width: 100%;
    max-width: 400px; /* PCでの入力欄の最大幅 */
    height: 44px;
    padding: 0 15px;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    font-size: 15px;
    background: #fff;
}

/* カテゴリーチップス */
.category-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 1em;
}

.chip-radio input { display: none; }
.chip-radio span {
    display: inline-block;
    padding: 9px 16px;
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
.chip-radio input:checked + span {
    background: var(--primary-light);
    color: var(--primary-dark);
    border-color: var(--primary);
}

/* 右寄せのコンパクトな検索ボタン */
.search-button-area-right {
    flex-shrink: 0; /* ボタンが潰れないように */
}

.btn-search-small {
    height: 44px;
    width: 120px; /* 横幅を小さく固定 */
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    padding:5px;
}

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

/* --- テーブル・その他 --- */
.table-wrapper { width: 100%; overflow-x: auto; }
.product-table { width: 100%; border-collapse: collapse; }
.product-table th { background: #f1f5f9; text-align: left; padding: 15px; font-size: 13px; color: var(--text-muted); }
.product-table td { padding: 18px 15px; border-bottom: 1px solid var(--border-soft); }
.model-name { font-weight: 800; color: #3c3c3c; font-size: 16px; }

.download-btns { display: flex; gap: 8px; }
.dl-link { display: flex; align-items: center; gap: 6px; text-decoration: none; padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 800; }
.dl-icon { width: 18px; height: auto; }
.dl-link.pdf { color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; }
.dl-link.dxf { color: #1e40af; background: #eff6ff; border: 1px solid #dbeafe; }

.detail-link { color: var(--primary); text-decoration: none; font-weight: 600; font-size: 14px; }

.pagination { margin-top: 40px; text-align: center; }
.page-links { display: flex; justify-content: center; gap: 8px; }
.page-num { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; text-decoration: none; border: 1px solid var(--border-soft); border-radius: 10px; color: var(--text-dark); font-weight: 600; }
.page-num.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* --- レスポンシブ --- */
@media (max-width: 768px) {
    .search-row-align { flex-direction: column; align-items: stretch; }
    .btn-search-small { width: 100%; } /* スマホでは押しやすさ優先で全幅 */
    .product-table thead { display: none; }
    .product-table tr { display: block; border: 1px solid var(--border-soft); border-radius: 12px; margin-bottom: 15px; background: #fff; }
    .product-table td { display: flex; justify-content: space-between; align-items: center; padding: 12px 15px; border-bottom: 1px dashed #eee; }
    .product-table td::before { content: attr(data-label); font-weight: 700; color: var(--text-muted); font-size: 12px; }
}



/* --- プロフィール画面専用スタイル --- */
.profile-actions {
    margin-top: 50px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.main-actions {
    display: flex;
    gap: 15px;
    width: 100%;
    justify-content: center;
}

.btn-update { flex: 1; max-width: 240px; }

.btn-outline {
    flex: 1; max-width: 240px;
    background: transparent !important;
    border: 2px solid var(--primary) !important;
    color: var(--primary) !important;
}

.danger-actions {
    margin-top: 10px;
    text-align: center;
}

.btn-text-danger {
    background: none; border: none;
    color: #94a3b8; font-size: 13px;
    text-decoration: underline; cursor: pointer;
}

/* メルマガ注釈エリア */
.form-footer-note {
    margin-top: 40px;
    padding: 20px;
    background-color: #f1f5f9;
    border-radius: 10px;
    text-align: center;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-muted);
}

.form-footer-note a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.form-footer-note a:hover {
    text-decoration: underline;
}

/* 登録画面と共通のバッジ */
.badge-req {
    background: var(--accent-red);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 5px;
    vertical-align: middle;
}

@media (max-width: 768px) {
    .main-actions { flex-direction: column; }
    .btn-update, .btn-outline { max-width: 100%; }
}

/* セレクトボックスの基本スタイル */
.select-field {
    width: 100%;
    height: 44px;
    padding: 0 15px;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    font-size: 15px;
    background-color: #fff;
    cursor: pointer;
}

/* アクションエリアの調整 */
.sub-actions {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 500px; /* ボタン群と幅を合わせる */
    border-top: 1px solid var(--border-soft);
    padding-top: 20px;
}

/* 戻るボタン */
.btn-back {
    background: none;
    border: 1px solid var(--border-soft);
    padding: 8px 20px;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-back:hover {
    background: #f1f5f9;
    color: var(--text-dark);
}

/* 退会ボタンの微調整（右側に配置されるよう） */
.btn-text-danger {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
}

/* ==========================================
   ヘッダーナビゲーション（追加分）
   ========================================== */
.header-top-nav {
    display: flex;
    justify-content: flex-end;
    align-items: anchor-center;
    margin-bottom: -10px;
}

.nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    background-color: #fff;
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.nav-button:hover {
    background-color: var(--primary);
    color: #fff;
    transform: translateY(-1px);
}

/* モバイル対応の調整 */
@media (max-width: 768px) {
    .header-top-nav {
        margin-bottom: 10px;
    }
}

.user-menu-container {
    display: inline-block;
    position: relative;
}


/* 会員メニュー用スタイル */
.menu-trigger {
    cursor: pointer;
    border: none;
    outline: none;
}

/* ドロップダウンメニューの基本設定 */
.user-dropdown {
    display: none; /* 初期は非表示 */
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: 1px solid #ddd;
    border-radius: 4px;
    z-index: 1000;
    min-width: 140px;
    margin-top: 5px;
}

/* クラスが付与された時だけ表示 */
.user-menu-container.is-open .user-dropdown {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    border-bottom: 1px solid #eee;
}

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

.dropdown-item:hover {
    background-color: #f5f5f5;
}

.dropdown-item.logout {
    color: #e74c3c; /* ログアウトは赤色 */
}

/* スマホ用の調整 */
@media (max-width: 768px) {
    .user-dropdown {
        width: 160px; /* スマホでは少し大きく */
    }
}
/* 会員メニュー用スタイルここまで */

/* --- 検索テキストクリアボタン --- */
.search-input-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
}

/* type="search"のデフォルトの×ボタンを隠す */
.input-field::-webkit-search-cancel-button {
    appearance: none;
}

.clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: #eee;
    border: none;
    color: #666;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: none; /* 初期は非表示 */
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s;
}

.clear-btn:hover {
    background: #e2e8f0;
}

/* 入力がある時だけ表示させるための補助（JS併用） */
.input-field:focus + .clear-btn,
.input-field:not(:placeholder-shown) + .clear-btn {
    display: flex;
}

/* カテゴリーレイアウト用スタイル */
@media (min-width: 769px) {
	.category-grid {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 0 30px;
	}
	.group-ケミカルポンプ { grid-column: 1; grid-row: 1; }
	.group-プロミネント { grid-column: 2; grid-row: 1; }
	.group-撹拌機 { grid-column: 1; grid-row: 2; }
	.group-タンク { grid-column: 2; grid-row: 2; }
	.group-溶解装置 { grid-column: 1 / span 2; grid-row: 3; }

	/* PC表示時に同じカテゴリ・シリーズの連続を隠す */
	.hidden-on-pc {
		visibility: hidden;
	}
}
