/**
 * Contact Registration Form Styles
 * 連絡先の登録フォームのスタイル
 *
 * @package SHIPS Child
 * @subpackage Features\ContactRegistration\Assets
 */

/* ==========================================================================
   Page wrapper
   ========================================================================== */
#douyu-wrapper .ships-contact-registration-form-wrapper {
    max-width: 720px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem;
}

@media (max-width: 640px) {
    #douyu-wrapper .ships-contact-registration-form-wrapper {
        padding: 1.5rem 1rem;
    }
}

#douyu-wrapper .ships-contact-registration-form-wrapper .form-title {
    margin: 0 0 0.75rem 0;
    font-size: 1.625rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.02em;
}

#douyu-wrapper .ships-contact-registration-form-wrapper .form-intro {
    margin-bottom: 2rem;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #2271b1;
    color: #475569;
    font-size: 0.9375rem;
    line-height: 1.65;
}

#douyu-wrapper .ships-contact-registration-existing .form-intro-existing {
    border-left-color: #64748b;
}

/* ==========================================================================
   Form card
   ========================================================================== */
#douyu-wrapper .ships-contact-registration-form {
    background: #fff;
    padding: 2rem 2rem 2.25rem;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
}

@media (max-width: 640px) {
    #douyu-wrapper .ships-contact-registration-form {
        padding: 1.5rem 1.25rem;
        border-radius: 10px;
    }
}

/* ==========================================================================
   Sections
   ========================================================================== */
#douyu-wrapper .ships-contact-registration-form .form-section {
    margin-bottom: 2.25rem;
}

#douyu-wrapper .ships-contact-registration-form .form-section:last-of-type {
    margin-bottom: 0;
}

#douyu-wrapper .ships-contact-registration-form .section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem 0;
    padding-bottom: 0.625rem;
    border-bottom: 2px solid #e2e8f0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
}

#douyu-wrapper .ships-contact-registration-form .section-title::before {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    height: 1.75rem;
    padding: 0 0.25rem;
    background: #2271b1;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 700;
    border-radius: 6px;
}

#douyu-wrapper .ships-contact-registration-form .form-section:nth-of-type(1) .section-title::before {
    content: "1";
}

#douyu-wrapper .ships-contact-registration-form .form-section:nth-of-type(2) .section-title::before {
    content: "2";
}

#douyu-wrapper .ships-contact-registration-form .form-note {
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.6;
}

/* ご本人情報（参照）セクション */
#douyu-wrapper .ships-contact-registration-form .form-section:first-of-type {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.5rem 1.75rem;
    margin-bottom: 2rem;
}

#douyu-wrapper .ships-contact-registration-form .form-section:first-of-type .section-title {
    border-bottom-color: #cbd5e1;
}

#douyu-wrapper .ships-contact-registration-form .form-section:first-of-type .form-note {
    margin-bottom: 1.25rem;
}

/* ==========================================================================
   Contact section (A + 連絡先一覧)
   ========================================================================== */
#douyu-wrapper .ships-contact-registration-form .form-section-contact .form-note {
    margin-bottom: 1.5rem;
}

#douyu-wrapper .ships-contact-registration-form .form-option-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

#douyu-wrapper .ships-contact-registration-form .form-option-card:last-child {
    margin-bottom: 0;
}

#douyu-wrapper .ships-contact-registration-form .form-option-card-a {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-color: #bae6fd;
}

#douyu-wrapper .ships-contact-registration-form .form-option-card-title {
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

#douyu-wrapper .ships-contact-registration-form .form-option-card .form-row {
    margin-bottom: 1rem;
}

#douyu-wrapper .ships-contact-registration-form .form-option-card .form-row:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Form rows & labels
   ========================================================================== */
#douyu-wrapper .ships-contact-registration-form .form-row {
    margin-bottom: 1.25rem;
}

#douyu-wrapper .ships-contact-registration-form .form-row-half {
    display: inline-block;
    width: calc(50% - 0.5rem);
    vertical-align: top;
    margin-right: 0.5rem;
}

@media (max-width: 520px) {
    #douyu-wrapper .ships-contact-registration-form .form-row-half {
        display: block;
        width: 100%;
        margin-right: 0;
        margin-bottom: 1rem;
    }
}

#douyu-wrapper .ships-contact-registration-form .form-label,
#douyu-wrapper .ships-contact-registration-form .form-option-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

/* Required field badge (入会と同じ) */
#douyu-wrapper .ships-contact-registration-form .form-label .required-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    background-color: #ef4444;
    border-radius: 0.25rem;
    line-height: 1.4;
    vertical-align: middle;
    white-space: nowrap;
}

#douyu-wrapper .ships-contact-registration-form .form-label .required {
    display: none;
}

/* ==========================================================================
   Read-only values & inputs
   ========================================================================== */
#douyu-wrapper .ships-contact-registration-form .form-value-readonly {
    display: block;
    padding: 0.625rem 0.875rem;
    min-height: 2.5rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #1e293b;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.5;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

#douyu-wrapper .ships-contact-registration-form .form-section:first-of-type .form-value-readonly {
    background: #fff;
    border-color: #cbd5e1;
}

#douyu-wrapper .ships-contact-registration-form .form-value-readonly.form-value-empty {
    color: #94a3b8;
    font-weight: 400;
}

#douyu-wrapper .ships-contact-registration-form .form-input,
#douyu-wrapper .ships-contact-registration-form .form-textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.9375rem;
    color: #1e293b;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#douyu-wrapper .ships-contact-registration-form .form-input::placeholder,
#douyu-wrapper .ships-contact-registration-form .form-textarea::placeholder {
    color: #94a3b8;
}

#douyu-wrapper .ships-contact-registration-form .form-input:focus,
#douyu-wrapper .ships-contact-registration-form .form-textarea:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.2);
}

/* ==========================================================================
   A option row (label + value)
   ========================================================================== */
#douyu-wrapper .ships-contact-registration-form .form-row-option.form-row-label-value {
    display: flex;
    align-items: stretch;
    gap: 1rem;
}

#douyu-wrapper .ships-contact-registration-form .form-row-option.form-row-label-value .form-label-with-option {
    flex: 0 0 auto;
    min-width: 0;
    margin-bottom: 0;
    padding: 0.5rem 0 0;
}

#douyu-wrapper .ships-contact-registration-form .form-row-option.form-row-label-value .form-option-label {
    padding: 0;
    background: transparent;
    border: none;
    font-weight: 500;
    color: #374151;
}

#douyu-wrapper .ships-contact-registration-form .form-row-option.form-row-label-value .form-value-readonly {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0.5rem 0 0;
    min-height: auto;
}

#douyu-wrapper .ships-contact-registration-form .form-row-option .form-option-label {
    padding: 0.75rem 1rem;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

/* ==========================================================================
   Contact table (連絡先一覧)
   ========================================================================== */
#douyu-wrapper .ships-contact-registration-form .form-note-inline {
    margin-bottom: 1rem;
    font-size: 0.8125rem;
    color: #64748b;
    line-height: 1.55;
}

#douyu-wrapper .ships-contact-registration-form .form-contacts-table {
    width: 100%;
}

#douyu-wrapper .ships-contact-registration-form .form-contacts-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

#douyu-wrapper .ships-contact-registration-form .form-contacts-row-header {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}

#douyu-wrapper .ships-contact-registration-form .form-contacts-col-row {
    flex: 0 0 2.5rem;
    width: 2.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #475569;
}

#douyu-wrapper .ships-contact-registration-form .form-contacts-row-header .form-contacts-col-row {
    font-weight: 600;
}

#douyu-wrapper .ships-contact-registration-form .form-contacts-col-row-num {
    font-weight: 500;
    color: #374151;
}

#douyu-wrapper .ships-contact-registration-form .form-contacts-col-name {
    flex: 0 0 36%;
    min-width: 0;
}

#douyu-wrapper .ships-contact-registration-form .form-contacts-col-email {
    flex: 1;
    min-width: 0;
}

#douyu-wrapper .ships-contact-registration-form .form-contacts-col-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

#douyu-wrapper .ships-contact-registration-form .form-contacts-row .form-input {
    width: 100%;
}

#douyu-wrapper .ships-contact-registration-form .form-contacts-row-hidden {
    display: none;
}

#douyu-wrapper .ships-contact-registration-form .form-contacts-row-add-wrap {
    margin-top: 0.75rem;
    margin-bottom: 0;
}

@media (max-width: 520px) {
    #douyu-wrapper .ships-contact-registration-form .form-contacts-row {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    #douyu-wrapper .ships-contact-registration-form .form-contacts-col-row {
        flex: 0 0 2.5rem;
    }
    #douyu-wrapper .ships-contact-registration-form .form-contacts-col-name {
        flex: 1 1 calc(100% - 3rem);
    }
    #douyu-wrapper .ships-contact-registration-form .form-contacts-col-email {
        flex: 1 1 100%;
    }
}

/* ==========================================================================
   Add contact button
   ========================================================================== */
#douyu-wrapper .ships-contact-registration-form .form-add-contact-button {
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #2271b1;
    background: #fff;
    border: 1px solid #2271b1;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

#douyu-wrapper .ships-contact-registration-form .form-add-contact-button:hover {
    background: #2271b1;
    color: #fff;
}

/* ==========================================================================
   Privacy section (same as monbassador)
   ========================================================================== */
#douyu-wrapper .ships-contact-registration-form .form-privacy-text {
    font-size: 0.875rem;
    color: #475569;
    line-height: 1.6;
}
#douyu-wrapper .ships-contact-registration-form .form-privacy-body {
    margin: 1rem 0;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    max-height: 12rem;
    overflow-y: auto;
}
#douyu-wrapper .ships-contact-registration-form .form-privacy-body h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.9375rem;
    color: #1e293b;
}
#douyu-wrapper .ships-contact-registration-form .form-privacy-body ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1.25rem;
}
#douyu-wrapper .ships-contact-registration-form .form-row-checkbox {
    margin-top: 1rem;
    margin-bottom: 0;
}
#douyu-wrapper .ships-contact-registration-form .form-row-checkbox label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}

/* ==========================================================================
   Submit & messages
   ========================================================================== */
#douyu-wrapper .ships-contact-registration-form .form-row-submit {
    margin-top: 2rem;
    margin-bottom: 0;
    padding-top: 1.5rem;
    border-top: 2px solid #e2e8f0;
}

#douyu-wrapper .ships-contact-registration-form .form-submit-button {
    padding: 0.75rem 2.5rem;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.05s ease;
}

#douyu-wrapper .ships-contact-registration-form .form-submit-button:hover {
    background: #135e96;
}

#douyu-wrapper .ships-contact-registration-form .form-submit-button:active {
    transform: translateY(1px);
}

#douyu-wrapper .ships-contact-registration-form .form-errors {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #991b1b;
    font-size: 0.9375rem;
}

#douyu-wrapper .ships-contact-registration-form .form-errors ul {
    margin: 0;
    padding-left: 1.25rem;
}

#douyu-wrapper .ships-contact-registration-form .form-success {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    color: #166534;
    font-size: 0.9375rem;
}

/* ==========================================================================
   Existing application view (登録済み・削除して再申請)
   ========================================================================== */
/* Card: same as form for consistency */
#douyu-wrapper .ships-contact-registration-existing .ships-contact-registration-existing-card {
    background: #fff;
    padding: 2rem 2rem 2.25rem;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
}

@media (max-width: 640px) {
    #douyu-wrapper .ships-contact-registration-existing .ships-contact-registration-existing-card {
        padding: 1.5rem 1.25rem;
        border-radius: 10px;
    }
}

/* Intro message for existing view */
#douyu-wrapper .ships-contact-registration-existing .form-intro-existing {
    margin-bottom: 1.5rem;
}

/* Section blocks */
#douyu-wrapper .ships-contact-registration-existing .form-section-view {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
}

#douyu-wrapper .ships-contact-registration-existing .form-section-view:last-of-type {
    margin-bottom: 0;
}

#douyu-wrapper .ships-contact-registration-existing .form-section-view .section-title {
    margin-bottom: 1.25rem;
    padding-bottom: 0.625rem;
    border-bottom: 2px solid #e2e8f0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
}

#douyu-wrapper .ships-contact-registration-existing .form-section-view .section-title::before {
    content: none;
    display: none;
}

/* Read-only rows in existing view */
#douyu-wrapper .ships-contact-registration-existing .form-section-view .form-row {
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.75rem;
}

#douyu-wrapper .ships-contact-registration-existing .form-section-view .form-row.form-row-half {
    display: inline-flex;
    width: calc(50% - 0.5rem);
    vertical-align: top;
    margin-right: 0.5rem;
}

#douyu-wrapper .ships-contact-registration-existing .form-section-view .form-row:last-child {
    margin-bottom: 0;
}

@media (max-width: 520px) {
    #douyu-wrapper .ships-contact-registration-existing .form-section-view .form-row.form-row-half {
        display: flex;
        width: 100%;
        margin-right: 0;
    }
}

#douyu-wrapper .ships-contact-registration-existing .form-section-view .form-label {
    flex: 0 0 auto;
    margin-bottom: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #64748b;
}

#douyu-wrapper .ships-contact-registration-existing .form-section-view .form-value-readonly {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0.25rem 0;
    min-height: auto;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #1e293b;
}

#douyu-wrapper .ships-contact-registration-existing .form-section-view .form-value-readonly.form-value-empty {
    color: #94a3b8;
    font-weight: 400;
}

/* Contact table in existing view */
#douyu-wrapper .ships-contact-registration-existing .form-contacts-table-view .form-contacts-row-header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #475569;
}

#douyu-wrapper .ships-contact-registration-existing .form-contacts-table-view .form-contacts-row {
    margin-bottom: 0.625rem;
    padding: 0.375rem 0;
    border-bottom: 1px solid #f1f5f9;
}

#douyu-wrapper .ships-contact-registration-existing .form-contacts-table-view .form-contacts-row:last-child {
    border-bottom: none;
}

#douyu-wrapper .ships-contact-registration-existing .form-contacts-table-view .form-value-readonly,
#douyu-wrapper .ships-contact-registration-existing .form-contacts-table-view .form-contacts-col-label {
    padding: 0;
    min-height: auto;
    background: transparent;
    border: none;
    box-shadow: none;
    font-size: 0.9375rem;
    color: #1e293b;
}

/* Meta block (登録日・ステータス) */
#douyu-wrapper .ships-contact-registration-existing .form-row-meta-wrap {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

#douyu-wrapper .ships-contact-registration-existing .form-row-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.8125rem;
    color: #64748b;
}

#douyu-wrapper .ships-contact-registration-existing .form-row-meta:last-child {
    margin-bottom: 0;
}

#douyu-wrapper .ships-contact-registration-existing .form-row-meta .form-label {
    flex: 0 0 auto;
    margin-bottom: 0;
    font-weight: 600;
    color: #64748b;
}

#douyu-wrapper .ships-contact-registration-existing .form-row-meta .form-value-readonly {
    flex: 1;
    min-width: 0;
    padding: 0;
    min-height: auto;
    background: transparent;
    border: none;
    font-weight: 500;
    color: #1e293b;
}

/* Delete / re-apply button area */
#douyu-wrapper .ships-contact-registration-existing .form-row-submit {
    margin-top: 1.75rem;
    margin-bottom: 0;
    padding-top: 1.5rem;
    border-top: 2px solid #e2e8f0;
}

#douyu-wrapper .ships-contact-registration-form .form-delete-reapply-button,
#douyu-wrapper .ships-contact-registration-existing .form-delete-reapply-button {
    padding: 0.65rem 1.75rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #b91c1c;
    background: #fff;
    border: 1px solid #b91c1c;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

#douyu-wrapper .ships-contact-registration-form .form-delete-reapply-button:hover,
#douyu-wrapper .ships-contact-registration-existing .form-delete-reapply-button:hover {
    background: #b91c1c;
    color: #fff;
}

#douyu-wrapper .ships-contact-registration-form .form-delete-reapply-button:disabled,
#douyu-wrapper .ships-contact-registration-existing .form-delete-reapply-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Legacy: form-contacts-table-view when inside form (shared) */
#douyu-wrapper .ships-contact-registration-form .form-contacts-table-view .form-value-readonly {
    padding: 0.35rem 0;
    min-height: auto;
}

#douyu-wrapper .ships-contact-registration-form .form-contacts-table-view .form-contacts-row {
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   Legacy / inline form-row-c-entry (if used)
   ========================================================================== */
#douyu-wrapper .ships-contact-registration-form .form-label-inline {
    display: inline-block;
    min-width: 3.5em;
    margin-right: 0.5rem;
    margin-bottom: 0;
    vertical-align: middle;
    font-size: 0.875rem;
}

#douyu-wrapper .ships-contact-registration-form .form-input-inline {
    display: inline-block;
    width: 48%;
    margin-right: 2%;
}

#douyu-wrapper .ships-contact-registration-form .form-row-c-entry {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

#douyu-wrapper .ships-contact-registration-form .form-row-c-entry .form-label-inline {
    flex: 0 0 auto;
}

#douyu-wrapper .ships-contact-registration-form .form-row-c-entry .form-input-inline:nth-child(2) {
    width: 28%;
    min-width: 120px;
}

#douyu-wrapper .ships-contact-registration-form .form-row-c-entry .form-input-inline:nth-child(3) {
    width: 60%;
    min-width: 160px;
    margin-right: 0;
}
