@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;
}

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

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

/* 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 */
.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="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 */
.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 and Radios */
.checkbox-group, .radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.checkbox-label, .radio-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, .radio-label:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

.checkbox-label input[type="checkbox"],
.radio-label input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    margin-right: 12px;
    position: relative;
    cursor: pointer;
    background-color: #ffffff;
    transition: all 0.2s;
}

.checkbox-label input[type="checkbox"] { border-radius: 4px; }
.radio-label input[type="radio"] { border-radius: 50%; }

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

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

.radio-label input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 5px;
    width: 6px;
    height: 6px;
    background-color: white;
    border-radius: 50%;
}

/* Section Divider */
.form-section-title {
    padding: 40px 40px 10px;
    font-size: 18px;
    font-weight: 700;
    color: #1e3a8a;
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-section-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background-color: #3b82f6;
    border-radius: 999px;
}

/* Annotations */
.form-annotation {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}

/* Submit Button */
.submit-row {
    padding: 40px;
    background-color: #f8fafc;
    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);
    color: #ffffff;
    border: none;
    padding: 18px 80px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.1em;
    cursor: pointer;
    border-radius: 9999px;
    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);
}

/* Responsive */
@media screen and (max-width: 800px) {
    .custom-form-row { grid-template-columns: 1fr; }
    .custom-form-label { padding: 20px 20px 5px; }
    .custom-form-inputs { padding: 10px 20px 25px; }
    .label-width-1 { min-width: unset; width: 100%; margin-bottom: 5px; }
    .input-line { flex-direction: column; align-items: stretch; gap: 8px; }
    .btn-submit { width: 100%; padding: 16px; }
}
