/* ==========================================================================
   会員マイページ スタイル
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #FAFBFC;
    color: #2D3748;
    line-height: 1.6;
}

a { color: #2596be; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ヘッダー */
.mypage-header {
    background: #fff;
    border-bottom: 1px solid #E2E8F0;
    padding: 0 1.5rem;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.mypage-brand {
    font-size: 1.125rem;
    font-weight: 600;
    color: #2596be;
}

.mypage-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
}

.mypage-user-name { font-weight: 500; }

.btn-logout {
    color: #718096;
    font-size: 0.8125rem;
    padding: 0.25rem 0.75rem;
    border: 1px solid #E2E8F0;
    border-radius: 4px;
    transition: background 0.2s;
}
.btn-logout:hover { background: #EDF2F7; text-decoration: none; }

/* コンテンツ */
.mypage-content {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.mypage-page-title {
    font-size: 1.375rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #2D3748;
}

/* パネル */
.mypage-panel {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.panel-title {
    font-size: 1rem;
    font-weight: 600;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #E2E8F0;
    background: #F7FAFC;
}

/* 案件一覧 */
.case-list { list-style: none; }

.case-list-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #EDF2F7;
    transition: background 0.15s;
}
.case-list-item:last-child { border-bottom: none; }
.case-list-item:hover { background: #F7FAFC; }

.case-list-info { flex: 1; min-width: 0; }

.case-list-title {
    font-weight: 500;
    color: #2D3748;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.case-list-meta {
    font-size: 0.8125rem;
    color: #718096;
    display: flex;
    gap: 1rem;
}

.case-list-arrow {
    color: #A0AEC0;
    flex-shrink: 0;
}

/* ステータスバッジ */
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.badge-new { background: rgba(66,153,225,0.12); color: #2B6CB0; }
.badge-reviewing { background: rgba(0,188,212,0.12); color: #00838F; }
.badge-progress { background: rgba(237,137,54,0.12); color: #C05621; }
.badge-hold { background: rgba(160,174,192,0.15); color: #4A5568; }
.badge-waiting { background: rgba(236,201,75,0.15); color: #975A16; }
.badge-completed { background: rgba(72,187,120,0.12); color: #276749; }
.badge-withdrawn { background: rgba(229,62,62,0.1); color: #C53030; }

/* 案件詳細 */
.case-detail-header {
    padding: 1.25rem;
    border-bottom: 1px solid #E2E8F0;
}

.case-detail-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.case-detail-meta {
    font-size: 0.8125rem;
    color: #718096;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* フォーム表示 */
.form-display { padding: 1.25rem; }

.form-display dl {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 0;
}

.form-display dt {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #4A5568;
    padding: 0.625rem 0.75rem;
    background: #F7FAFC;
    border-bottom: 1px solid #EDF2F7;
}

.form-display dd {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid #EDF2F7;
    word-break: break-word;
}

/* メッセージ */
.message-list {
    padding: 1.25rem;
    max-height: 500px;
    overflow-y: auto;
}

.message-item {
    margin-bottom: 1rem;
    max-width: 80%;
}

.message-item--member {
    margin-right: auto;
}

.message-item--admin {
    margin-left: auto;
}

.message-bubble {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.message-item--member .message-bubble {
    background: #EDF2F7;
    border-bottom-left-radius: 4px;
}

.message-item--admin .message-bubble {
    background: #EBF8FF;
    border-bottom-right-radius: 4px;
}

.message-sender {
    font-size: 0.75rem;
    font-weight: 500;
    color: #718096;
    margin-bottom: 0.25rem;
}

.message-item--admin .message-sender { text-align: right; }

.message-time {
    font-size: 0.6875rem;
    color: #A0AEC0;
    margin-top: 0.25rem;
}

.message-item--admin .message-time { text-align: right; }

.no-messages {
    text-align: center;
    color: #A0AEC0;
    padding: 2rem;
}

/* メッセージ送信フォーム */
.message-form {
    padding: 1rem 1.25rem;
    border-top: 1px solid #E2E8F0;
    background: #F7FAFC;
}

.message-form textarea {
    width: 100%;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    padding: 0.75rem;
    font-size: 0.9375rem;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
}

.message-form textarea:focus {
    outline: none;
    border-color: #2596be;
    box-shadow: 0 0 0 3px rgba(37,150,190,0.1);
}

.message-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.75rem;
}

.btn-primary {
    background: #2596be;
    color: #fff;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-primary:hover { background: #1E7A9C; }

/* 添付ファイル */
.attachment-list {
    list-style: none;
    padding: 1rem 1.25rem;
}

.attachment-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #EDF2F7;
    font-size: 0.875rem;
}
.attachment-list li:last-child { border-bottom: none; }

.attachment-size { color: #A0AEC0; font-size: 0.75rem; }

/* 戻るリンク */
.back-link {
    display: inline-block;
    font-size: 0.875rem;
    color: #718096;
    margin-bottom: 1rem;
}
.back-link:hover { color: #2596be; }

/* ログイン画面 */
.login-page {
    min-height: 100dvh;
    background:
        linear-gradient(120deg, rgba(28, 86, 94, 0.08), rgba(231, 151, 94, 0.08)),
        #f5f7f7;
    color: #17252b;
}

.login-shell {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 4vw, 4rem);
}

.login-panel {
    width: min(100%, 440px);
}

.login-card {
    width: 100%;
    padding: clamp(2rem, 5vw, 3.25rem);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(216, 226, 226, 0.9);
    border-radius: 8px;
    box-shadow: 0 28px 70px rgba(24, 45, 52, 0.14);
    backdrop-filter: blur(18px);
}

.login-brand {
    display: block;
    margin-bottom: 2rem;
}

.login-brand-name {
    display: grid;
    gap: 0.28rem;
    color: #17252b;
    letter-spacing: 0;
    text-align: center;
}

.login-brand-name span:first-child {
    font-size: 1.28rem;
    font-weight: 800;
    line-height: 1.3;
}

.login-brand-name span:last-child {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.5;
    color: #607177;
}

.login-title {
    font-size: 1.35rem;
    line-height: 1.35;
    font-weight: 700;
    color: #17252b;
    margin-bottom: 1.5rem;
    letter-spacing: 0;
    text-align: center;
}

.login-form {
    display: grid;
    gap: 1rem;
}

.login-field {
    text-align: left;
}

.login-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: #33464d;
    margin-bottom: 0.45rem;
}

.login-field input {
    width: 100%;
    min-height: 56px;
    padding: 0.9rem 1rem;
    border: 1px solid #d3dddd;
    border-radius: 8px;
    background: #fbfdfd;
    color: #17252b;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.login-field input::placeholder {
    color: #8ea0a5;
}

.login-field input:focus {
    outline: none;
    border-color: #207f91;
    box-shadow: 0 0 0 4px rgba(32, 127, 145, 0.14);
    background: #fff;
}

.login-btn {
    width: 100%;
    min-height: 56px;
    padding: 0.9rem 1rem;
    background: #1f7f8c;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    margin-top: 0.45rem;
    box-shadow: 0 16px 32px rgba(31, 127, 140, 0.24);
    transition: transform 0.16s, box-shadow 0.16s, background 0.16s;
}
.login-btn:hover {
    background: #176f7c;
    transform: translateY(-1px);
    box-shadow: 0 20px 40px rgba(31, 127, 140, 0.3);
}
.login-btn:active { transform: translateY(0); }
.login-btn:focus-visible {
    outline: 3px solid rgba(32, 127, 145, 0.26);
    outline-offset: 3px;
}

.login-error {
    background: #fff1f1;
    border: 1px solid #ffd2d2;
    color: #b83232;
    padding: 0.8rem 0.95rem;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    text-align: left;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .login-shell {
        align-items: center;
        padding: 1rem;
    }
    .login-panel {
        width: 100%;
    }
    .login-card {
        padding: 1.5rem;
    }
    .login-brand {
        margin-bottom: 1.65rem;
    }
    .login-brand-name span:first-child {
        font-size: 1.16rem;
    }
    .login-brand-name span:last-child {
        font-size: 0.82rem;
        overflow-wrap: anywhere;
    }
    .login-title {
        font-size: 1.2rem;
    }
    .form-display dl {
        grid-template-columns: 1fr;
    }
    .form-display dt {
        border-bottom: none;
        padding-bottom: 0.25rem;
    }
    .form-display dd {
        padding-top: 0;
    }
    .case-detail-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
}
