/* =====================================================
   /apply/ サービス申込フォーム
   ===================================================== */

.apply-page main { background: #fafafa; }

.apply-main {
    padding-bottom: 4rem;
}

/* Hero */
.apply-hero {
    background: linear-gradient(180deg, #fff5ec 0%, #fafafa 100%);
    padding: 5rem 0 2.5rem;
}
.apply-h1 {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 1rem;
}
.apply-lead {
    font-size: 1rem;
    line-height: 1.9;
    color: #444;
    margin-bottom: 1.6rem;
}
.apply-lead a { color: var(--primary-orange); text-decoration: underline; }

/* Progress indicator */
.apply-progress {
    display: flex; gap: 0.6rem; flex-wrap: wrap;
    padding: 0.8rem;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.apply-progress-step {
    flex: 1; min-width: 180px;
    padding: 0.7rem 1rem;
    background: #f4f4f4; color: #888;
    border-radius: 8px;
    font-size: 0.92rem; font-weight: 600;
    text-align: center;
    transition: all 0.3s;
}
.apply-progress-step.is-active {
    background: var(--primary-orange); color: var(--white);
    box-shadow: 0 4px 12px rgba(239, 77, 134, 0.3);
}
.apply-progress-step.is-done {
    background: #e7f1fb; color: #2c5482;
}

/* Form container */
.apply-section { padding: 2.5rem 0; }
.apply-container { max-width: 920px; }
.apply-form {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.06);
    padding: 2rem 1.6rem;
}
.apply-step { border: none; padding: 0; margin: 0; }
.apply-step[hidden] { display: none; }
.apply-step.is-active { display: block; }

.apply-legend {
    width: 100%;
    font-size: 1.15rem; font-weight: 700;
    color: var(--primary-orange);
    margin-bottom: 1.5rem;
    padding-bottom: 0.7rem;
    border-bottom: 2px solid #fde8d4;
}
.apply-h2 {
    font-size: 1.05rem; font-weight: 700;
    color: var(--text-dark);
    margin: 1.6rem 0 0.8rem;
    padding: 0.5rem 0.8rem;
    background: #fffaf6;
    border-left: 4px solid var(--primary-orange);
    border-radius: 4px;
}
.apply-h3 {
    font-size: 0.95rem; font-weight: 700;
    color: var(--text-dark);
    margin: 0.8rem 0 0.5rem;
}
.apply-note {
    font-size: 0.85rem; color: #777; line-height: 1.7;
    background: #f8f8f8; padding: 0.8rem 1rem; border-radius: 8px;
    margin: 0.8rem 0;
}
.apply-note a { color: var(--primary-orange); text-decoration: underline; }

/* Plan cards */
.apply-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.9rem;
    margin-bottom: 0.8rem;
}
.apply-plan-card { display: block; cursor: pointer; }
.apply-plan-card input { position: absolute; opacity: 0; }
.apply-plan-card-inner {
    display: block;
    border: 2px solid #ececec;
    background: var(--white);
    padding: 1rem;
    border-radius: 12px;
    transition: all 0.2s;
}
.apply-plan-card:hover .apply-plan-card-inner {
    border-color: #f3c0a0;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}
.apply-plan-card input:checked + .apply-plan-card-inner {
    border-color: var(--primary-orange);
    background: #fff5ec;
    box-shadow: 0 4px 16px rgba(239, 77, 134, 0.15);
}
.apply-plan-name {
    display: block;
    font-size: 1.1rem; font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 0.3rem;
}
.apply-plan-badge {
    display: inline-block;
    background: var(--primary-orange); color: var(--white);
    font-size: 0.65rem; font-weight: 700;
    padding: 2px 8px; border-radius: 999px; vertical-align: middle;
    margin-left: 0.3em;
}
.apply-plan-target {
    display: block;
    font-size: 0.78rem; color: #777;
    margin-bottom: 0.4rem;
}
.apply-plan-price {
    display: block;
    font-size: 0.95rem; font-weight: 700;
    color: var(--primary-orange);
}
.apply-plan-initial {
    display: block;
    font-size: 0.78rem; color: #888;
    margin-top: 0.2rem;
}

/* 対象サービスマトリクステーブル */
.apply-services-table-wrap {
    overflow-x: auto;
    margin: 0.8rem 0;
    border-radius: 12px;
    border: 1px solid #ececec;
}
.apply-services-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}
.apply-services-table thead th {
    background: #faf5f1;
    padding: 0.7rem 0.6rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    border-bottom: 2px solid #ececec;
}
.apply-services-table thead th:first-child {
    text-align: left;
    min-width: 200px;
}
.apply-services-table tbody th {
    padding: 0.7rem 0.8rem;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-dark);
    text-align: left;
    border-bottom: 1px solid #f3f3f3;
}
.apply-services-table tbody td {
    padding: 0.6rem;
    text-align: center;
    border-bottom: 1px solid #f3f3f3;
}
.apply-services-table tbody tr:last-child th,
.apply-services-table tbody tr:last-child td {
    border-bottom: none;
}
.apply-services-table tbody tr:hover {
    background: #fffaf6;
}
.apply-services-table label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 4px;
}
.apply-services-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-orange);
}

/* Form fields */
.apply-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem 1rem;
}
@media (max-width: 600px) {
    .apply-grid-2col { grid-template-columns: 1fr; }
}
.apply-field { display: flex; flex-direction: column; gap: 0.3rem; }
.apply-field-wide { grid-column: 1 / -1; }
.apply-field-label {
    font-size: 0.82rem; font-weight: 600;
    color: var(--text-dark);
}
.apply-required {
    display: inline-block;
    background: var(--primary-orange); color: var(--white);
    font-size: 0.65rem;
    padding: 1px 6px; border-radius: 4px;
    margin-left: 0.3em; vertical-align: middle;
}
.apply-field input[type="text"],
.apply-field input[type="email"],
.apply-field input[type="tel"],
.apply-field input[type="url"],
.apply-field input[type="date"],
.apply-field select,
.apply-field textarea {
    padding: 0.7rem 0.9rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-dark);
    background: var(--white);
    border: 1.5px solid #e5e5e5;
    border-radius: 8px;
    transition: border-color 0.2s;
}
.apply-field input:focus,
.apply-field select:focus,
.apply-field textarea:focus {
    outline: none;
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgba(239, 77, 134, 0.1);
}
.apply-field input[aria-invalid="true"],
.apply-field select[aria-invalid="true"] {
    border-color: var(--danger);
    background: #fff5f5;
}
.apply-field textarea { resize: vertical; min-height: 90px; }

/* Agree checklist */
.apply-agree-list {
    list-style: none;
    margin: 1rem 0;
    padding: 0;
    display: flex; flex-direction: column;
    gap: 0.6rem;
}
.apply-agree-item {
    background: #fafafa;
    border: 1.5px solid #ececec;
    border-radius: 10px;
    padding: 0.8rem 1rem;
    transition: all 0.2s;
}
.apply-agree-item:has(input:checked) {
    background: #f3fdf3;
    border-color: #b6dfb6;
}
.apply-agree-item.apply-agree-master {
    background: #fff5ec;
    border: 2px solid var(--primary-orange);
}
.apply-agree-item label {
    display: flex; gap: 0.7rem;
    align-items: flex-start;
    cursor: pointer;
    font-size: 0.92rem; line-height: 1.7;
}
.apply-agree-item input[type="checkbox"] {
    flex-shrink: 0;
    width: 20px; height: 20px;
    margin-top: 2px;
    accent-color: var(--primary-orange);
}
.apply-agree-item a { color: var(--primary-orange); text-decoration: underline; }

/* Step actions */
.apply-step-actions {
    display: flex;
    gap: 0.8rem;
    margin-top: 2rem;
    padding-top: 1.2rem;
    border-top: 1px solid #eee;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.apply-step-actions button {
    flex: 0 0 auto; min-width: 200px;
}
@media (max-width: 600px) {
    .apply-step-actions { flex-direction: column-reverse; }
    .apply-step-actions button { width: 100%; }
}

.apply-btn-prev,
.apply-btn-next,
.apply-btn-submit {
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem; font-weight: 700;
    padding: 0.85rem 1.4rem;
    border-radius: 999px;
    border: none;
    transition: all 0.2s;
}
.btn-secondary.apply-btn-prev {
    background: #f0f0f0; color: var(--text-dark);
}
.btn-secondary.apply-btn-prev:hover { background: #e5e5e5; }

.btn-primary.apply-btn-next,
.btn-primary.apply-btn-submit {
    background: var(--primary-orange); color: var(--white);
}
.btn-primary.apply-btn-next:hover,
.btn-primary.apply-btn-submit:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(239, 77, 134, 0.25); }
.btn-primary.apply-btn-submit { background: #2a8b4f; }
.btn-primary.apply-btn-submit:hover { background: #267d47; box-shadow: 0 6px 16px rgba(42, 139, 79, 0.25); }

/* Summary on STEP 3 */
.apply-summary {
    background: #fafafa;
    border: 1px solid #ececec;
    border-radius: 12px;
    padding: 1.4rem;
    margin: 1rem 0;
}
.apply-summary h3 {
    font-size: 0.92rem; font-weight: 700;
    color: var(--primary-orange);
    margin: 1.2rem 0 0.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid #f3e0e8;
}
.apply-summary h3:first-child { margin-top: 0; }
.apply-summary-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 0.5rem;
    padding: 0.4rem 0;
    border-bottom: 1px dashed #eee;
    font-size: 0.92rem;
}
@media (max-width: 600px) {
    .apply-summary-row { grid-template-columns: 1fr; gap: 0.1rem; padding: 0.6rem 0; }
}
.apply-summary-row:last-child { border-bottom: none; }
.apply-summary-key { font-weight: 600; color: #666; }
.apply-summary-val { color: var(--text-dark); word-break: break-all; }
.apply-summary-empty { color: #aaa; font-style: italic; }

.apply-final-notice {
    margin: 1rem 0;
    padding: 1rem; background: #fff5ec;
    border-radius: 8px;
    font-size: 0.88rem; line-height: 1.8; color: #444;
}

/* Validation error message */
.apply-error {
    padding: 0.8rem 1rem;
    background: #fff5f5;
    border: 1.5px solid var(--danger);
    border-radius: 8px;
    color: var(--danger);
    font-size: 0.9rem;
    margin-top: 1rem;
    display: none;
}
.apply-error.is-shown { display: block; }

/* Thanks page */
.apply-thanks .apply-h1 {
    text-align: center;
    color: #2a8b4f;
    margin-top: 3rem;
}
.apply-thanks .apply-lead { text-align: center; }
.apply-thanks-box {
    background: #f8fdf8;
    border: 1.5px solid #c4e8c4;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin: 2rem 0;
}
.apply-thanks-steps {
    margin-left: 1.4rem;
    line-height: 1.9;
    font-size: 0.95rem;
}
.apply-thanks-steps li { margin-bottom: 0.4rem; }
.apply-thanks-actions {
    text-align: center; margin: 2rem 0 1rem;
}
.apply-thanks-contact {
    text-align: center; font-size: 0.85rem; color: #666;
    margin-top: 1rem; line-height: 1.8;
}
.apply-thanks-contact a { color: var(--primary-orange); }
