/* css/member-facility.css */

/* =====================================================
   施設タイプグリッド
   ===================================================== */
   .facility-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.facility-type-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.facility-type-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.facility-type-card.ineligible {
    opacity: 0.85;
    background: #f9fafb;
}

.type-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.type-icon-large {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.type-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.25rem;
}

.type-fee {
    font-size: 0.95rem;
    color: #6b7280;
    margin: 0;
}

.type-description {
    font-size: 0.9rem;
    color: #4b5563;
    margin: 0 0 1rem;
    line-height: 1.5;
}

.type-requirements {
    background: #f9fafb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.type-requirements h4 {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0 0 0.5rem;
    font-weight: 500;
}

.type-requirements ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.type-requirements li {
    font-size: 0.85rem;
    color: #374151;
    padding: 0.25rem 0;
    padding-left: 1.25rem;
    position: relative;
}

.type-requirements li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #9ca3af;
}

.type-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.ineligible-reason {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #6b7280;
    background: #f3f4f6;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

/* =====================================================
   施設ステータスカード
   ===================================================== */
.facility-status-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.facility-status-card.active {
    border-left: 4px solid #10b981;
}

.facility-status-card.expiring {
    border-left: 4px solid #f59e0b;
    background: #fffbeb;
}

.facility-status-card.expired {
    border-left: 4px solid #ef4444;
    background: #fef2f2;
}

.facility-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.facility-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
}

.facility-type-badge.large {
    padding: 0.5rem 1rem;
    font-size: 1rem;
}

.facility-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.facility-status-badge.active {
    background: #d1fae5;
    color: #059669;
}

.facility-status-badge.expiring {
    background: #fef3c7;
    color: #d97706;
}

.facility-status-badge.expired {
    background: #fee2e2;
    color: #dc2626;
}

.facility-info {
    margin-bottom: 1rem;
}

.facility-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.25rem;
}

.facility-cert-number {
    font-size: 0.85rem;
    color: #6b7280;
}

.facility-period {
    background: #f9fafb;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.period-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.period-label {
    font-size: 0.85rem;
    color: #6b7280;
}

.period-value {
    font-size: 0.9rem;
    font-weight: 500;
    color: #111827;
}

.expiry-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #fde68a;
    font-size: 0.85rem;
    color: #b45309;
}

.facility-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* =====================================================
   施設申請カード
   ===================================================== */
.facility-application-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.application-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.application-status-badge {
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.application-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.25rem;
}

.application-info p {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0;
}

.payment-reminder,
.draft-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #fff7ed;
    border-radius: 8px;
    margin-top: 1rem;
}

.payment-reminder {
    background: #fff7ed;
    color: #c2410c;
}

.reminder-icon {
    font-size: 1.25rem;
}

/* =====================================================
   施設申請モーダル
   ===================================================== */
.modal-lg {
    max-width: 720px;
}

.modal-md {
    max-width: 560px;
}

.modal-title-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.type-icon-modal {
    font-size: 2rem;
}

.modal-subtitle {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0.25rem 0 0;
}

.facility-fee-info {
    display: flex;
    gap: 2rem;
    padding: 1rem;
    background: #f0fdf4;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.fee-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.fee-label {
    font-size: 0.8rem;
    color: #6b7280;
}

.fee-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #059669;
}

/* ステップインジケーター */
.step-indicators {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.step-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f3f4f6;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #6b7280;
    transition: all 0.2s ease;
}

.step-indicator.active {
    background: #3b82f6;
    color: #fff;
}

.step-indicator.completed {
    background: #d1fae5;
    color: #059669;
}

.step-number {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.8rem;
}

.step-indicator.active .step-number {
    background: rgba(255, 255, 255, 0.3);
}

.step-indicator.completed .step-number::before {
    content: "✓";
}

/* ステップコンテンツ */
.facility-app-step {
    display: none;
}

.facility-app-step.active {
    display: block;
}

.step-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.5rem;
}

.step-description {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0 0 1.5rem;
}

/* フォーム行 */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   スタッフ要件
   ===================================================== */
.staff-requirement-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.requirement-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.requirement-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.requirement-count {
    font-size: 0.8rem;
    color: #6b7280;
    background: #e5e7eb;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.requirement-desc {
    font-size: 0.9rem;
    color: #4b5563;
    margin: 0 0 0.75rem;
}

.requirement-note {
    font-size: 0.8rem;
    color: #059669;
    background: #ecfdf5;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    margin: 0 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.add-staff-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* 選択されたスタッフ */
.selected-staff-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}

.staff-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.staff-name {
    font-weight: 500;
    color: #111827;
}

.self-badge {
    font-size: 0.7rem;
    background: #dbeafe;
    color: #1d4ed8;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
}

.staff-type {
    font-size: 0.8rem;
    color: #6b7280;
}

.staff-details {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.staff-member-id {
    font-size: 0.8rem;
    color: #9ca3af;
}

.btn-remove-staff {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-remove-staff:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* 資格バッジ（小） */
.cert-mini-badge {
    font-size: 0.7rem;
    background: #f3f4f6;
    color: #4b5563;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
}

/* =====================================================
   会員検索モーダル
   ===================================================== */
.search-target-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #f0f9ff;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.target-label {
    font-size: 0.85rem;
    color: #6b7280;
}

.target-value {
    font-weight: 500;
    color: #1d4ed8;
}

.search-input-wrapper {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.search-input-wrapper .form-input {
    flex: 1;
}

.member-search-results {
    max-height: 400px;
    overflow-y: auto;
}

.search-placeholder,
.search-loading,
.search-empty,
.search-error {
    text-align: center;
    padding: 2rem 1rem;
    color: #6b7280;
}

.search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.member-search-result {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.member-search-result:hover {
    background: #f9fafb;
    border-color: #3b82f6;
}

.member-result-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.member-result-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-result-avatar span {
    font-size: 1.25rem;
    font-weight: 500;
    color: #6b7280;
}

.member-result-info {
    flex: 1;
    min-width: 0;
}

.member-result-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: #111827;
}

.member-type-badge {
    font-size: 0.7rem;
    background: #f3f4f6;
    color: #6b7280;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
}

.member-result-id {
    font-size: 0.8rem;
    color: #9ca3af;
    margin-top: 0.125rem;
}

.member-result-certs {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.375rem;
}

.member-result-action {
    flex-shrink: 0;
}

/* =====================================================
   プレビュー・確認
   ===================================================== */
.preview-section {
    background: #f9fafb;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.preview-section h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (max-width: 640px) {
    .preview-grid {
        grid-template-columns: 1fr;
    }
}

.preview-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.preview-label {
    font-size: 0.8rem;
    color: #6b7280;
}

.preview-value {
    font-size: 0.9rem;
    color: #111827;
}

.preview-staff-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.preview-staff-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.preview-staff-item .staff-role {
    font-size: 0.8rem;
    background: #e5e7eb;
    color: #4b5563;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    min-width: 100px;
}

.preview-staff-item .staff-name {
    font-weight: 500;
}

.preview-staff-item .staff-id {
    font-size: 0.85rem;
    color: #9ca3af;
}

.fee-summary {
    background: #f0fdf4;
}

.fee-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    color: #374151;
}

.fee-row.total {
    border-top: 1px solid #d1fae5;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    font-weight: 600;
    color: #059669;
}

/* =====================================================
   支払い方法選択
   ===================================================== */
.payment-method-selection {
    margin-top: 1.5rem;
}

.payment-method-selection h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 1rem;
}

.payment-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (max-width: 480px) {
    .payment-options {
        grid-template-columns: 1fr;
    }
}

.payment-option {
    cursor: pointer;
}

.payment-option input {
    display: none;
}

.payment-option .option-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    transition: all 0.2s;
}

.payment-option input:checked + .option-content {
    border-color: #3b82f6;
    background: #eff6ff;
}

.option-icon {
    font-size: 1.5rem;
}

.option-label {
    font-weight: 500;
    color: #111827;
}

.option-desc {
    font-size: 0.75rem;
    color: #6b7280;
}

/* =====================================================
   同意セクション
   ===================================================== */
.agreement-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #374151;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 0.125rem;
    cursor: pointer;
}

.checkbox-label a {
    color: #3b82f6;
    text-decoration: none;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* =====================================================
   施設詳細・更新
   ===================================================== */
.facility-detail,
.facility-renewal {
    padding: 0.5rem 0;
}

.facility-detail-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.facility-detail-section {
    margin-bottom: 1.5rem;
}

.facility-detail-section h4 {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0 0 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-grid {
    display: grid;
    gap: 0.75rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-item .label {
    font-size: 0.8rem;
    color: #6b7280;
}

.detail-item .value {
    font-size: 0.95rem;
    color: #111827;
}

.staff-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.staff-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
}

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

.advisor-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.advisor-name {
    font-weight: 500;
}

.advisor-hospital {
    font-size: 0.85rem;
    color: #6b7280;
}

/* 更新モーダル */
.renewal-facility-info {
    text-align: center;
    margin-bottom: 1.5rem;
}

.renewal-facility-info h3 {
    font-size: 1.25rem;
    margin: 0.75rem 0 0.25rem;
}

.renewal-facility-info p {
    color: #6b7280;
    margin: 0;
}

.renewal-period-info {
    background: #f9fafb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.renewal-period-info .period-row {
    padding: 0.5rem 0;
}

.renewal-period-info .period-row.new {
    border-top: 1px solid #e5e7eb;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
}

.renewal-period-info .period-row.new .value {
    color: #059669;
    font-weight: 600;
}

.renewal-fee-info {
    background: #f0fdf4;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

/* =====================================================
   申請履歴テーブル
   ===================================================== */
.facility-history-table {
    width: 100%;
    border-collapse: collapse;
}

.facility-history-table th,
.facility-history-table td {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.facility-history-table th {
    font-size: 0.8rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.facility-history-table td {
    font-size: 0.9rem;
    color: #374151;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* =====================================================
   紹介カード
   ===================================================== */
.facility-intro-card {
    text-align: center;
    padding: 2rem;
}

.intro-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.facility-intro-card h3 {
    font-size: 1.25rem;
    color: #111827;
    margin: 0 0 0.75rem;
}

.facility-intro-card p {
    color: #6b7280;
    margin: 0.5rem 0;
    line-height: 1.6;
}

/* =====================================================
   要件詳細モーダル
   ===================================================== */
.requirements-detail {
    padding: 0.5rem 0;
}

.requirement-item {
    margin-bottom: 1.25rem;
}

.requirement-item h4 {
    font-size: 0.95rem;
    color: #111827;
    margin: 0 0 0.5rem;
}

.requirement-item p {
    font-size: 0.9rem;
    color: #4b5563;
    margin: 0;
    line-height: 1.5;
}

.requirement-item p.note {
    font-size: 0.85rem;
    color: #059669;
    background: #ecfdf5;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    margin-top: 0.5rem;
}

.requirement-notes {
    background: #f9fafb;
    border-radius: 8px;
    padding: 1rem;
}

.requirement-notes h4 {
    font-size: 0.9rem;
    margin: 0 0 0.5rem;
}

.requirement-notes ul {
    list-style-position: inside;
    padding: 0;
    margin: 0;
}

.requirement-notes li {
    font-size: 0.85rem;
    color: #4b5563;
    padding: 0.25rem 0;
}

/* =====================================================
   申請詳細（却下など）
   ===================================================== */
.application-detail .detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.application-detail .detail-section {
    margin-bottom: 1.25rem;
}

.application-detail .detail-section h4 {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0 0 0.75rem;
}

.application-detail .detail-section.rejection {
    background: #fef2f2;
    border-radius: 8px;
    padding: 1rem;
}

.application-detail .detail-section.rejection h4 {
    color: #dc2626;
}

.application-detail .detail-section.rejection p {
    color: #7f1d1d;
    margin: 0;
}

/* =====================================================
   空状態
   ===================================================== */
.empty-state-small {
    text-align: center;
    padding: 1.5rem;
    color: #9ca3af;
    font-size: 0.9rem;
}

/* =====================================================
   サブセクション
   ===================================================== */
.subsection-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 1.5rem 0 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.subsection-desc {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0 0 1rem;
}

/* =====================================================
   レスポンシブ調整
   ===================================================== */
@media (max-width: 768px) {
    .facility-types-grid {
        grid-template-columns: 1fr;
    }
    
    .facility-fee-info {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .step-indicators {
        flex-wrap: wrap;
    }
    
    .step-indicator {
        flex: 1;
        min-width: 100px;
        justify-content: center;
    }
    
    .step-label {
        display: none;
    }
}