@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&family=Inter:wght@400;500;700&display=swap');

/* Reset and Base */
.form-wrapper {
    width: 100%;
    max-width: 900px;
    margin: 40px auto;
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    color: #374151; /* gray-700 */
    font-size: 15px;
    line-height: 1.6;
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.08), 0 10px 15px -5px rgba(0, 0, 0, 0.04);
}

.form-wrapper * {
    box-sizing: border-box;
}

.hp-field {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/* Header */
.form-main-title {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: #ffffff;
    text-align: center;
    padding: 30px 20px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.05em;
    position: relative;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    border-bottom: 4px solid #facc15; /* subtle accent */
}

/* Form Container */
.custom-contact-form {
    display: flex;
    flex-direction: column;
}

/* Rows (CSS Grid for modern layout) */
.custom-form-row {
    display: grid;
    grid-template-columns: 280px 1fr;
    border-bottom: 1px solid #f3f4f6; /* gray-100 */
    transition: background-color 0.2s ease;
}

.custom-form-row:hover {
    background-color: #f8fafc; /* slate-50 */
}

.custom-form-row:last-of-type {
    border-bottom: none;
}

/* Left Column (Labels) */
.custom-form-label {
    padding: 30px 40px;
    font-weight: 700;
    color: #111827; /* gray-900 */
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap; /* allow badge to go next line if tight */
}

/* Required Badge */
.required-badge {
    background-color: #ef4444; /* red-500 */
    color: #ffffff;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 9999px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
    align-self: flex-start;
    margin-top: 3px;
}

/* Right Column (Inputs) */
.custom-form-inputs {
    padding: 30px 40px 30px 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Alignments inside inputs */
.input-line {
    display: flex;
    align-items: center;
    gap: 16px;
}

.flex-inline-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Labels inline with inputs (like 会社名) */
.label-width-1 {
    width: auto;
    min-width: 140px;
    color: #4b5563; /* gray-600 */
    font-weight: 600;
    font-size: 14px;
}
.label-width-2 {
    width: auto;
    min-width: 80px;
    color: #4b5563;
    font-weight: 600;
    font-size: 14px;
}

/* Specific Sizes */
.input-w-xs { width: 80px; text-align: center; }
.input-w-sm { width: 100px; text-align: center; }
.input-w-md { flex: 1; max-width: 250px; }
.input-w-lg { flex: 1; max-width: 400px; }
.input-w-xl { flex: 1; max-width: 400px; }
.input-textarea { width: 100%; min-height: 180px; resize: vertical; }
.input-select { width: 220px; }

/* Inputs and Textareas */
input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
    border: 1px solid #d1d5db; /* gray-300 */
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 15px;
    font-family: inherit;
    color: #1f2937; /* gray-800 */
    background-color: #f9fafb; /* gray-50 */
    transition: all 0.2s ease-in-out;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #3b82f6; /* blue-500 */
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15); /* blue glow */
}

input::placeholder, textarea::placeholder {
    color: #9ca3af;
}

.align-center {
    align-items: center;
}

/* Inline texts (like - or 確認用) */
.inline-text {
    font-size: 13px;
    color: #6b7280;
    font-weight: 600;
}

.hyphen {
    color: #9ca3af;
    font-weight: 700;
}

/* Address search Button */
.btn-zip-search {
    background-color: #f3f4f6; /* gray-100 */
    border: 1px solid #d1d5db;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 700;
    color: #4b5563;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn-zip-search:hover {
    background-color: #e5e7eb;
    color: #1f2937;
    border-color: #9ca3af;
}

/* Checkboxes */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 12px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
    color: #334155;
}

.checkbox-label:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

/* Custom Checkbox Appearance */
.checkbox-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid #cbd5e1;
    border-radius: 5px;
    margin-right: 12px;
    position: relative;
    cursor: pointer;
    background-color: #ffffff;
    transition: all 0.2s;
}

.checkbox-label input[type="checkbox"]:checked {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Modern pseudo-class glow */
.checkbox-label:has(input[type="checkbox"]:checked) {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

/* Annotations */
.form-annotation {
    font-size: 13px;
    color: #4b5563;
    margin-top: 8px;
    line-height: 1.6;
}

.form-annotation p {
    margin: 4px 0 0 0;
}

.form-annotation a {
    color: #3b82f6;
    text-decoration: none;
}

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

/* Submit Button */
.submit-row {
    padding: 40px;
    background-color: #f8fafc; /* very light gray */
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: center;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

.btn-submit {
    background: linear-gradient(135deg, #2563eb, #3b82f6); /* blue gradient */
    color: #ffffff;
    border: none;
    padding: 18px 80px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.1em;
    cursor: pointer;
    border-radius: 9999px; /* pill shape */
    box-shadow: 0 10px 20px -5px rgba(59, 130, 246, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px -5px rgba(59, 130, 246, 0.5);
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
}

.btn-submit:active {
    transform: translateY(1px);
    box-shadow: 0 5px 10px -2px rgba(59, 130, 246, 0.4);
}

/* Responsive (Mobile/Tablet) */
@media screen and (max-width: 800px) {
    .form-wrapper {
        margin: 20px auto;
        border-radius: 12px;
        max-width: calc(100% - 40px);
    }
    
    .custom-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .custom-form-label {
        padding: 24px 20px 10px 20px;
        padding-bottom: 12px; /* close to inputs */
        font-size: 16px;
        background-color: transparent; /* Remove highlight on mobile */
    }
    
    .custom-form-inputs {
        padding: 0 20px 30px 20px;
    }
    
    .label-width-1,
    .label-width-2 {
        min-width: unset;
        width: 100%;
        margin-bottom: 8px;
        display: block;
        font-size: 14px;
    }
    
    .input-line {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .flex-inline-group {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .input-w-lg,
    .input-w-xl,
    .input-w-md,
    .input-textarea {
        max-width: none;
        width: 100%;
    }
    
    .input-w-xs { width: 30%; max-width: 80px; text-align: left; }
    .input-w-sm { width: 35%; max-width: 100px; text-align: left; }

    .checkbox-group {
        grid-template-columns: 1fr;
    }
    
    .btn-zip-search {
        flex-grow: 1; /* Button takes available space on mobile */
        text-align: center;
    }
    
    .submit-row {
        padding: 30px 20px;
    }
    
    .btn-submit {
        width: 100%;
        padding: 16px 20px;
    }
}

/* ========================================
   確認セクション
   ======================================== */

/* 確認前の案内テキスト */
.confirm-intro {
    text-align: center;
    padding: 20px 40px;
    margin: 0;
    font-size: 15px;
    color: #1e40af;
    background-color: #eff6ff;
    border-bottom: 1px solid #bfdbfe;
}

/* 確認テーブル本体 */
.confirm-table {
    display: flex;
    flex-direction: column;
}

/* 各行 */
.confirm-row {
    display: grid;
    grid-template-columns: 240px 1fr;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s ease;
}

.confirm-row:hover {
    background-color: #f8fafc;
}

/* 左列（ラベル） */
.confirm-label {
    padding: 18px 30px;
    font-weight: 700;
    font-size: 14px;
    color: #374151;
    background-color: #f9fafb;
    border-right: 1px solid #e5e7eb;
    display: flex;
    align-items: flex-start;
}

/* 右列（値） */
.confirm-value {
    padding: 18px 30px;
    color: #111827;
    font-size: 15px;
    word-break: break-word;
}

/* テキストエリア系（改行を保持） */
.confirm-multiline {
    white-space: pre-wrap;
    line-height: 1.7;
}

/* 未入力・選択なしの薄いスタイル */
.confirm-value:empty::before,
.confirm-value[data-empty="true"] {
    color: #9ca3af;
    font-style: italic;
}

/* ボタンエリア */
.confirm-buttons {
    padding: 40px;
    background-color: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

/* 修正するボタン */
.btn-back {
    background-color: #ffffff;
    color: #374151;
    border: 2px solid #d1d5db;
    padding: 16px 40px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 9999px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-back:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
    color: #111827;
}

/* この内容で送信するボタン */
.btn-submit-confirm {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #ffffff;
    border: none;
    padding: 18px 60px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.08em;
    cursor: pointer;
    border-radius: 9999px;
    box-shadow: 0 10px 20px -5px rgba(34, 197, 94, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

.btn-submit-confirm:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px -5px rgba(34, 197, 94, 0.5);
    background: linear-gradient(135deg, #15803d, #16a34a);
}

.btn-submit-confirm:active {
    transform: translateY(1px);
    box-shadow: 0 5px 10px -2px rgba(34, 197, 94, 0.4);
}

.btn-submit-confirm:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ========================================
   確認セクション レスポンシブ
   ======================================== */
@media screen and (max-width: 800px) {
    .confirm-intro {
        padding: 16px 20px;
        font-size: 14px;
    }

    .confirm-row {
        grid-template-columns: 1fr;
    }

    .confirm-label {
        padding: 14px 20px 6px 20px;
        background-color: transparent;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        font-size: 13px;
        color: #6b7280;
    }

    .confirm-value {
        padding: 10px 20px 18px 20px;
        font-size: 15px;
    }

    .confirm-buttons {
        flex-direction: column-reverse;
        padding: 30px 20px;
        gap: 12px;
    }

    .btn-back,
    .btn-submit-confirm {
        width: 100%;
        text-align: center;
        padding: 16px 20px;
    }

    .btn-submit-confirm {
        font-size: 16px;
    }

    .confirm-warning {
        margin: 15px 20px;
        padding: 12px 16px;
        font-size: 13px;
    }
}

/* 注意書きのスタイル */
.confirm-warning {
    margin: 20px 40px;
    padding: 16px 24px;
    background-color: #fef2f2; /* extremely soft red */
    border: 1px solid #fecaca; /* red accent */
    border-radius: 8px;
    color: #991b1b; /* dark red text */
    font-size: 14px;
    font-weight: 500;
    line-height: 1.6;
    display: flex;
    align-items: center;
    gap: 12px;
}

.confirm-warning::before {
    content: "⚠️";
    font-size: 18px;
    flex-shrink: 0;
}
