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

/* ===== 横スクロール防止 ===== */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* 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;
}

/* 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"],
input[type="number"],
input[type="file"],
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="file"] {
    padding: 10px;
    cursor: pointer;
    background-color: #ffffff;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="file"]: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: 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 */
.upload-step-title {
    font-size: 14px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 8px;
}

.separator-dotted {
    border-top: 1px dashed #d1d5db;
    margin: 10px 0;
    width: 100%;
}

.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;
    }
    
    .input-line.phone-input-group {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }
    
    .phone-input-group .input-w-xs {
        flex: 1;
        width: auto;
        max-width: 100px;
        text-align: center;
    }
    
    .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;
    }
}

/* Optional Badge */
.optional-badge {
    background-color: #94a3b8; /* slate-400 */
    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(148, 163, 184, 0.2);
    align-self: flex-start;
    margin-top: 3px;
}

.optional-badge { background-color: #94a3b8; color: #ffffff; font-size: 11px; padding: 4px 10px; border-radius: 9999px; line-height: 1; font-weight: 700; letter-spacing: 0.05em; align-self: flex-start; margin-top: 3px; }

