/* =========================================================
   AUM Profile — YITH Quote Page Profile Section
   ========================================================= */

/* ── 外层容器 ─────────────────────────────────────────── */

.aum-yith-profile-section {
    margin-top: 32px;
    padding: 24px 28px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.aum-yith-profile-section h3 {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
}

.aum-yith-profile-section > p {
    margin: 0 0 16px;
    color: #666;
    font-size: 14px;
}

/* ── 所需証件提示條 ───────────────────────────────────── */

#aum-required-doc-notice {
    display: none;
    background: #fff8e1;
    border-left: 4px solid #f9a825;
    padding: 10px 14px;
    margin-bottom: 16px;
    border-radius: 4px;
    font-size: 14px;
    color: #5d4037;
    line-height: 1.5;
}

/* ── Profile 下拉選擇 ─────────────────────────────────── */

.aum-yith-profile-select-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.aum-yith-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.aum-yith-profile-select-wrap label,
#aum-yith-profile-docs h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #444;
}

.aum-yith-profile-select-wrap select {
    width: 100%;
    max-width: 420px;
    padding: 9px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    background: #fff;
    color: #333;
    appearance: auto;
}

/* ── 已選中提示條 ─────────────────────────────────────── */

#aum-yith-selected-profile-info {
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    padding: 10px 14px;
    border-radius: 5px;
    font-size: 13px;
    color: #1d2327;
    margin-bottom: 8px;
}

/* EN: Edit Profile button — placed between info block and documents. */
/* ZH: 編輯 Profile 按鈕 — 位於資訊區與文件區之間。 */
#aum-yith-edit-profile-btn {
    margin-bottom: 12px;
}

/* EN: Edit form reuses .aum-form-card; override top-margin for h4. */
/* ZH: 編輯表單複用 .aum-form-card 樣式；覆寫 h4 首元素上邊距。 */
#aum-yith-edit-profile-form h4:not(:first-child) {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.aum-yith-selected-profile-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.aum-yith-selected-profile-row {
    display: grid;
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    padding: 8px 0;
    border-bottom: 1px solid #dcdcde;
}

.aum-yith-selected-profile-row:last-child {
    border-bottom: 0;
}

.aum-yith-selected-profile-label {
    font-weight: 600;
    color: #1d2327;
    word-break: break-word;
}

.aum-yith-selected-profile-value {
    color: #50575e;
    word-break: break-word;
}

/* ── 証件列表區塊 ─────────────────────────────────────── */

#aum-yith-profile-docs {
    margin-bottom: 18px;
}

#aum-yith-doc-list {
    margin-bottom: 12px;
}

.aum-doc-row {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 10px;
    background: #fafafa;
}

.aum-doc-row:last-child {
    margin-bottom: 0;
}

.aum-doc-row-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.aum-doc-row-main {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
}

.aum-doc-row-title {
    color: #1f2937;
}

.aum-doc-row-images {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

/* ── 証件操作按鈕組 ───────────────────────────────────── */

.aum-yith-btn {
    min-height: 34px;
    padding: 0 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    line-height: 32px;
    box-shadow: none;
}

.aum-yith-btn:hover,
.aum-yith-btn:focus {
    box-shadow: none;
}

.aum-yith-btn--secondary {
    background: #fff;
    border-color: #cbd5e1;
    color: #1f2937;
}

.aum-yith-btn--secondary:hover,
.aum-yith-btn--secondary:focus {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #111827;
}

.aum-yith-btn--primary {
    background: #1f2937;
    border-color: #1f2937;
    color: #fff;
}

.aum-yith-btn--primary:hover,
.aum-yith-btn--primary:focus {
    background: #111827;
    border-color: #111827;
    color: #fff;
}

.aum-yith-btn--text {
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid #2271b1;
    border-radius: 3px;
    background: #f6f7f7;
    font-size: 13px;
    font-weight: 400;
    line-height: 28px;
    color: #2271b1;
    text-decoration: none;
    vertical-align: top;
}

.aum-yith-btn--text:hover,
.aum-yith-btn--text:focus {
    background: #f0f0f1;
    border-color: #0a4b78;
    color: #0a4b78;
}

.aum-yith-delete-doc-btn.button-link-delete {
    margin-left: auto;
    padding: 0;
    border: 0;
    background: none;
    color: #b32d2e;
    font-size: 13px;
    line-height: 1.4;
    text-decoration: none;
    box-shadow: none;
}

.aum-yith-delete-doc-btn.button-link-delete:hover,
.aum-yith-delete-doc-btn.button-link-delete:focus-visible {
    background: none;
    color: #8a2424;
    text-decoration: underline;
}

/* ── Update Profile 按鈕（詳情頁）────────────────────── */

.aum-yith-update-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

#aum-yith-update-quote-btn {
    padding: 9px 20px;
    font-size: 14px;
    border-radius: 5px;
}

/* ── 表單卡片（新增 Profile / 編輯証件共用）─────────── */

.aum-form-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px 24px;
    margin-top: 12px;
    margin-bottom: 16px;
}

.aum-form-card h4 {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 700;
    color: #222;
}

/* 兩個 h4 之間的間距（Document 小標題）*/
.aum-form-card h4 + .aum-form-row {
    margin-top: 0;
}

#aum-yith-new-profile-form h4:not(:first-child) {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

/* ── 表單行 ───────────────────────────────────────────── */

.aum-form-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 14px;
}

.aum-form-row:last-of-type {
    margin-bottom: 0;
}

.aum-form-row label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
}

.aum-form-row input[type="text"],
.aum-form-row input[type="email"],
.aum-form-row select {
    width: 100%;
    max-width: 420px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    background: #fff;
    box-sizing: border-box;
}

.aum-form-row input[type="file"] {
    font-size: 13px;
    color: #555;
    max-width: 420px;
}

.aum-form-row input:focus,
.aum-form-row select:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26,115,232,.15);
}

.aum-doc-type-help {
    display: block;
    max-width: 420px;
    color: #666;
    font-size: 12px;
    line-height: 1.5;
}

/* ── 表單按鈕組 ───────────────────────────────────────── */

.aum-form-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

/* ── 訊息提示 ─────────────────────────────────────────── */

.aum-msg {
    font-size: 13px;
    margin-top: 8px;
    min-height: 18px;
    line-height: 1.4;
}

#aum-yith-validation-msg {
    margin-top: 12px;
    font-size: 14px;
    color: #c0392b;
    font-weight: 500;
    min-height: 20px;
}

#aum-yith-update-msg {
    font-size: 13px;
}

/* ── 審核狀態徽章 ─────────────────────────────────────── */

.aum-notice {
    padding: 10px 16px;
    border-radius: 5px;
    margin-top: 12px;
    font-size: 14px;
}

.aum-notice--approved {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.aum-notice--rejected {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.aum-notice--skipped {
    background: #eef2ff;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.aum-profile-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
}

.aum-profile-badge--pending  { background: #fff3cd; color: #856404; }
.aum-profile-badge--approved { background: #d4edda; color: #155724; }
.aum-profile-badge--rejected { background: #f8d7da; color: #721c24; }

.aum-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.aum-status--approved { background: #d1e7dd; color: #0a3622; }
.aum-status--rejected { background: #f8d7da; color: #58151c; }
.aum-status--skipped  { background: #e2e8f0; color: #334155; }

/* ── 登入提示 ─────────────────────────────────────────── */

.aum-login-notice {
    color: #666;
    font-size: 14px;
    padding: 10px 0;
}

/* ── Accept button disabled by profile verification ───── */
/* EN: Dedicated class that coexists with ecs-ywraq-disabled. */
/* ZH: 專屬 class，與 ecs-ywraq-disabled 共存不衝突。      */

.ywraq-accept.aum-profile-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.aum-accept-notice {
    background: #fff3cd;
    border-left: 4px solid #f9a825;
    padding: 0.6em 1em;
    margin: 0.5em 0;
    font-size: 0.95em;
    color: #856404;
}

@media (max-width: 640px) {
    .aum-yith-profile-section {
        padding: 20px 18px;
    }

    .aum-yith-profile-select-wrap select,
    .aum-form-row input[type="text"],
    .aum-form-row input[type="email"],
    .aum-form-row select,
    .aum-form-row input[type="file"],
    .aum-doc-type-help {
        max-width: 100%;
    }

    .aum-yith-selected-profile-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .aum-yith-delete-doc-btn.button-link-delete {
        margin-left: 0;
    }
}
