/* Form Page Styles */

.form-section {
    min-height: 100vh;
    padding: 120px 20px 80px;
    background: var(--light-bg);
}

.form-header {
    text-align: center;
    margin-bottom: 60px;
}

.form-badge {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white);
    padding: 10px 28px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(220, 20, 60, 0.4);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.form-title {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 900;
    color: var(--text-dark);
    margin-bottom: 16px;
    line-height: 1.3;
}

.form-subtitle {
    font-size: 16px;
    color: var(--text-gray);
}

.form-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    padding: 40px;
}

.application-form {
    display: flex;
    flex-direction: column;
    gap: 50px;
}

.form-section-group {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.section-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--primary-color);
    margin-bottom: 0;
}

.section-title i {
    color: var(--primary-color);
}

.section-note {
    font-size: 14px;
    color: var(--text-gray);
    margin-top: 8px;
    margin-bottom: 16px;
    line-height: 1.6;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-label.required::after {
    content: '必須';
    background: var(--primary-color);
    color: var(--white);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 700;
    margin-left: 8px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: var(--white);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-gray);
    opacity: 0.6;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    font-size: 13px;
    color: var(--text-gray);
}

.form-error {
    font-size: 13px;
    color: var(--primary-color);
    font-weight: 600;
    display: none;
}

.form-error.show {
    display: block;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Checkbox Cards */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.checkbox-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--white);
}

.checkbox-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.checkbox-input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkbox-input:checked ~ .checkbox-content {
    color: var(--text-dark);
}

.checkbox-input:checked ~ .checkbox-icon {
    display: block;
}

.checkbox-card.checkbox-input:checked {
    border-color: var(--primary-color);
    background: rgba(220, 20, 60, 0.05);
}

.checkbox-input:checked + .checkbox-content + .checkbox-icon {
    display: block;
}

/* 正しいセレクター */
.checkbox-card:has(.checkbox-input:checked) {
    border-color: var(--primary-color);
    background: rgba(220, 20, 60, 0.05);
    box-shadow: 0 4px 16px rgba(220, 20, 60, 0.2);
}

.checkbox-content {
    flex: 1;
}

.checkbox-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.checkbox-detail {
    font-size: 14px;
    color: var(--text-gray);
    margin-bottom: 8px;
}

.checkbox-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
}

.checkbox-icon {
    font-size: 28px;
    color: var(--primary-color);
    display: none;
}

.checkbox-card-special {
    border: 3px solid var(--accent-color);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(251, 191, 36, 0.05));
    position: relative;
}

.checkbox-card-special:hover {
    border-color: var(--accent-color);
}

.checkbox-card-special:has(.checkbox-input:checked) {
    border-color: var(--accent-color);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(251, 191, 36, 0.1));
}

.checkbox-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: var(--accent-color);
    color: var(--dark-bg);
    padding: 4px 12px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.total-price {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: var(--dark-bg);
    border-radius: 8px;
    margin-top: 8px;
}

.total-label {
    font-size: 18px;
    font-weight: 600;
    color: var(--white);
}

.total-amount {
    font-size: 32px;
    font-weight: 900;
    color: var(--accent-color);
}

/* Checkbox Label */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 15px;
    line-height: 1.6;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
}

/* Terms Box */
.terms-box {
    background: var(--light-bg);
    padding: 24px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    max-height: 400px;
    overflow-y: auto;
}

.terms-box h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 12px;
    margin-top: 20px;
}

.terms-box h3:first-child {
    margin-top: 0;
}

.terms-box ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 16px;
}

.terms-box li {
    padding-left: 20px;
    position: relative;
    margin-bottom: 8px;
    color: var(--text-gray);
    line-height: 1.7;
}

.terms-box li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: 700;
}

.terms-box p {
    color: var(--text-gray);
    line-height: 1.7;
}

/* Form Submit */
.form-submit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

.form-note {
    font-size: 13px;
    color: var(--text-gray);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: var(--white);
    border-radius: 8px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-gray);
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 1;
}

.modal-close:hover {
    color: var(--primary-color);
}

.modal-title {
    font-size: 28px;
    font-weight: 900;
    color: var(--text-dark);
    padding: 40px 40px 20px;
    border-bottom: 3px solid var(--primary-color);
}

.modal-body {
    padding: 30px 40px;
}

.confirm-section {
    margin-bottom: 30px;
}

.confirm-section:last-child {
    margin-bottom: 0;
}

.confirm-section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.confirm-section-title i {
    color: var(--primary-color);
}

.confirm-item {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.confirm-label {
    flex: 0 0 180px;
    font-weight: 600;
    color: var(--text-gray);
    font-size: 14px;
}

.confirm-value {
    flex: 1;
    color: var(--text-dark);
    font-size: 15px;
}

.confirm-highlight {
    background: rgba(220, 20, 60, 0.1);
    padding: 16px;
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
    margin-top: 16px;
}

.confirm-total {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

.modal-footer {
    display: flex;
    gap: 16px;
    padding: 20px 40px 40px;
    justify-content: center;
}

/* Complete Modal */
.complete-icon {
    text-align: center;
    font-size: 80px;
    color: var(--badge-green);
    padding-top: 40px;
}

.complete-message {
    font-size: 16px;
    line-height: 1.9;
    color: var(--text-dark);
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .form-container {
        padding: 24px;
    }

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

    .checkbox-card {
        padding: 16px;
    }

    .checkbox-title {
        font-size: 16px;
    }

    .total-price {
        flex-direction: column;
        gap: 8px;
    }

    .total-label {
        font-size: 16px;
    }

    .total-amount {
        font-size: 28px;
    }

    .modal-content {
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }

    .modal-title {
        font-size: 24px;
        padding: 30px 24px 16px;
    }

    .modal-body {
        padding: 20px 24px;
    }

    .modal-footer {
        flex-direction: column;
        padding: 20px 24px 30px;
    }

    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }

    .confirm-label {
        flex: 0 0 120px;
        font-size: 13px;
    }

    .confirm-value {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .form-title {
        font-size: 26px;
        line-height: 1.4;
    }
    
    .form-subtitle {
        font-size: 14px;
        line-height: 1.6;
    }

    .section-title {
        font-size: 18px;
        line-height: 1.5;
    }
    
    .section-note {
        font-size: 13px;
        line-height: 1.7;
    }

    .checkbox-title {
        font-size: 16px;
        line-height: 1.4;
    }

    .checkbox-detail {
        font-size: 13px;
        line-height: 1.6;
    }
    
    .checkbox-price {
        font-size: 15px;
    }
    
    .form-label {
        font-size: 14px;
        line-height: 1.5;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        font-size: 16px;
    }
    
    .form-hint {
        font-size: 12px;
        line-height: 1.6;
    }
    
    .terms-box {
        font-size: 13px;
        line-height: 1.7;
    }
    
    .terms-box h3 {
        font-size: 15px;
        line-height: 1.5;
    }

    .confirm-item {
        flex-direction: column;
        gap: 6px;
    }

    .confirm-label {
        flex: none;
        font-size: 13px;
    }
    
    .confirm-value {
        font-size: 15px;
        line-height: 1.6;
    }
    
    .modal-title {
        font-size: 22px;
        line-height: 1.4;
    }
    
    .complete-message {
        font-size: 15px;
        line-height: 1.9;
    }
}