/* ============================================================
   My Page — 마이페이지 전용 (auth-form CSS 와 함께 사용)
   ============================================================ */

.somako-mypage {
    max-width: 720px;
    margin: 3rem auto;
    padding: 0 1.5rem;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    color: #09090b;
    word-break: keep-all;
}

.somako-mypage-header {
    margin-bottom: 1.5rem;
}

.somako-mypage-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0 0 0.5rem;
    line-height: 1.3;
}

.somako-mypage-greet {
    font-size: 0.9375rem;
    color: #6b7280;
    margin: 0;
}

.somako-mypage-greet strong {
    color: #09090b;
    font-weight: 700;
}

/* 탭 */
.somako-mypage-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 2rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.somako-mypage-tab {
    flex-shrink: 0;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #6b7280;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.somako-mypage-tab:hover {
    color: #09090b;
}

.somako-mypage-tab.is-active {
    color: #d32f2f;
    border-bottom-color: #d32f2f;
}

/* 패널 */
.somako-mypage-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.875rem;
    padding: 2rem;
}

/* 패널 안의 form 카드 스타일 무효화 (이중 카드 방지) */
.somako-mypage-panel .somako-auth-form {
    margin: 0;
}

/* 빈 상태 */
.somako-mypage-empty {
    text-align: center;
    color: #9ca3af;
    font-size: 0.9375rem;
    padding: 2rem 0;
    margin: 0;
    line-height: 1.6;
}

/* 리스트 */
.somako-mypage-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.somako-mypage-item {
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #f3f4f6;
}

.somako-mypage-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.somako-mypage-item-link {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #09090b;
    text-decoration: none;
    margin-bottom: 0.375rem;
    line-height: 1.5;
}

.somako-mypage-item-link:hover {
    color: #d32f2f;
}

.somako-mypage-item-body {
    font-size: 0.875rem;
    color: #4b5563;
    line-height: 1.6;
    margin: 0 0 0.5rem;
}

.somako-mypage-item-meta {
    font-size: 0.75rem;
    color: #9ca3af;
    margin: 0;
}

.somako-mypage-meta-sep {
    margin: 0 0.5rem;
    color: #d1d5db;
}

/* 상태 배지 */
.somako-mypage-status {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.somako-mypage-status.is-approved {
    background: #fef2f2;
    color: #d32f2f;
}

.somako-mypage-status.is-pending {
    background: #f3f4f6;
    color: #6b7280;
}

/* 모바일 */
@media (max-width: 640px) {
    .somako-mypage {
        margin: 1.5rem auto;
        padding: 0 1rem;
    }

    .somako-mypage-title {
        font-size: 1.5rem;
    }

    .somako-mypage-panel {
        padding: 1.5rem 1.25rem;
    }
}

/* ============================================================
   프로필 이미지 업로드 블록
   ============================================================ */
.somako-mypage-avatar-block {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0 1rem;
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: 0.5rem;
}

.somako-mypage-avatar-preview {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
}

.somako-mypage-avatar-controls {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    flex: 1;
    min-width: 0;
}

.somako-mypage-avatar-pick {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    margin: 0;
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    cursor: pointer;
}

.somako-mypage-avatar-remove {
    width: fit-content;
    padding: 0;
    background: none;
    border: none;
    color: #6b7280;
    font-size: 0.75rem;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    text-align: left;
}
.somako-mypage-avatar-remove:hover {
    color: #d32f2f;
}

.somako-mypage-avatar-hint {
    font-size: 0.6875rem;
    color: #9ca3af;
    margin: 0.125rem 0 0;
    line-height: 1.5;
}

@media (max-width: 640px) {
    .somako-mypage-avatar-block {
        gap: 0.875rem;
    }
    .somako-mypage-avatar-preview {
        width: 60px;
        height: 60px;
    }
}

/* 파일 input 자체는 hidden; label 의 클릭으로 picker 띄움 */
.somako-mypage-avatar-pick input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* ============================================================
   프로필 크롭 모달 (Cropper.js + 자체 모달)
   ============================================================ */
.somako-cropper-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.somako-cropper-modal.is-open {
    display: flex;
}

.somako-cropper-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(9, 9, 11, 0.7);
    cursor: pointer;
}

.somako-cropper-dialog {
    position: relative;
    background: #fff;
    border-radius: 0.875rem;
    max-width: 560px;
    width: 100%;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    overflow: hidden;
}

.somako-cropper-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f3f4f6;
    flex-shrink: 0;
}

.somako-cropper-title {
    font-size: 1rem;
    font-weight: 700;
    color: #09090b;
    margin: 0;
}

.somako-cropper-close {
    background: none;
    border: none;
    font-size: 1.125rem;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
}
.somako-cropper-close:hover { color: #09090b; }

.somako-cropper-stage {
    background: #f9fafb;
    padding: 0.5rem;
    height: min(60vh, 520px);
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}
.somako-cropper-stage img {
    max-width: 100%;
    display: block;
}

/* Cropper 의 결과 영역을 원형으로 미리보기 (실제 저장은 정사각형) */
.somako-cropper-stage .cropper-view-box,
.somako-cropper-stage .cropper-face {
    border-radius: 50%;
}

.somako-cropper-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #f3f4f6;
    flex-shrink: 0;
}

.somako-cropper-zoom {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}
.somako-cropper-zoom-out,
.somako-cropper-zoom-in {
    width: 28px;
    height: 28px;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    color: #374151;
    line-height: 1;
    flex-shrink: 0;
    transition: border-color 0.15s ease;
}
.somako-cropper-zoom-out:hover,
.somako-cropper-zoom-in:hover {
    border-color: #d32f2f;
    color: #d32f2f;
}

.somako-cropper-zoom-range {
    flex: 1;
    height: 4px;
    accent-color: #d32f2f;
    cursor: pointer;
}

.somako-cropper-reset {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 0.8125rem;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
    flex-shrink: 0;
}
.somako-cropper-reset:hover { color: #d32f2f; }

.somako-cropper-footer {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    padding: 1rem 1.25rem;
    border-top: 1px solid #f3f4f6;
    flex-shrink: 0;
}
.somako-cropper-footer .somako-auth-btn {
    margin: 0;
    padding: 0.625rem 1.25rem;
}

@media (max-width: 640px) {
    .somako-cropper-dialog {
        max-width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
}

/* ============================================================
   소소레터 구독 토글 (마이페이지 > 프로필 탭 하단)
   ============================================================ */
.somako-mypage-notify {
    margin-top: 1.75rem;
    padding: 1.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.875rem;
    background: #fafafa;
}
.somako-mypage-notify-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.somako-mypage-notify-title {
    font-size: 1rem;
    font-weight: 700;
    color: #09090b;
    margin: 0;
}
.somako-mypage-notify-desc {
    font-size: 0.8125rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.55;
    word-break: keep-all;
}
.somako-mypage-notify-status {
    font-size: 0.8125rem;
    color: #6b7280;
    margin: 0.5rem 0 0;
    min-height: 1.1em;
}
.somako-mypage-notify-status.is-success { color: #16a34a; }
.somako-mypage-notify-status.is-error   { color: #d32f2f; }

/* 토글 스위치 (iOS 스타일) */
.somako-mypage-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.somako-mypage-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.somako-mypage-switch-track {
    position: absolute;
    inset: 0;
    background: #d1d5db;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.25s ease;
}
.somako-mypage-switch-track::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.25s ease;
}
.somako-mypage-switch input:checked + .somako-mypage-switch-track {
    background: #d32f2f;
}
.somako-mypage-switch input:checked + .somako-mypage-switch-track::before {
    transform: translateX(20px);
}
.somako-mypage-switch input:disabled + .somako-mypage-switch-track {
    opacity: 0.6;
    cursor: not-allowed;
}
