/* account-security.css — 마이페이지 계정보안 섹션 */

/* ── 변수 ─────────────────────────────────────────────────── */

.as-section {
    --as-primary:      #4a6da7;
    --as-primary-dark: #355285;
    --as-text:         #262626;
    --as-muted:        #6b6b6b;
    --as-border:       #e5e5e5;
    --as-surface-soft: #fafafa;
    --as-ok-bg:        #e4f5ed;
    --as-ok-text:      #1a6644;
    --as-warn-bg:      #fef3c7;
    --as-warn-text:    #7a4d0a;
    --as-danger:       #c24747;
    --as-success:      #1e7a52;
    --as-radius:       10px;
}

/* ── Row ─────────────────────────────────────────────────── */

.as-row {
    display: grid;
    grid-template-columns: 6.5rem 1fr;
    gap: 0.75rem 1.25rem;
    padding: 1.05rem 0;
}

.as-row + .as-row {
    border-top: 1px solid #ededed;
}

.as-row-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--as-muted);
    letter-spacing: 0.01em;
    line-height: 1.6;
    padding-top: 0.28rem;
}

.as-row-body {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

/* ── 배지 ────────────────────────────────────────────────── */

.as-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    padding: 0.22rem 0.68rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.5;
}

.as-badge i {
    font-size: 0.72rem;
}

.as-badge--ok {
    background: var(--as-ok-bg);
    color: var(--as-ok-text);
}

.as-badge--warn {
    background: var(--as-warn-bg);
    color: var(--as-warn-text);
}

/* ── 상태 행 (배지 + 버튼) ───────────────────────────────── */

.as-status-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

#as-email-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ── 로그인 방식 ─────────────────────────────────────────── */

#as-login-methods {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    padding-top: 0.1rem;
}

.as-method-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0.68rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 500;
    background: #f2f2f2;
    color: #333333;
    border: 1px solid #e0e0e0;
}

.as-method-tag i {
    font-size: 0.68rem;
}

.as-muted {
    font-size: 0.83rem;
    color: var(--as-muted);
}

/* ── OTP 영역 ────────────────────────────────────────────── */

#as-otp-area {
    background: var(--as-surface-soft);
    border: 1px solid var(--as-border);
    border-radius: var(--as-radius);
    padding: 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.as-otp-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}


.as-otp-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.82rem;
    line-height: 1.6;
    margin-top: 0.3rem;
}

.as-otp-timer {
    color: var(--as-muted);
    font-variant-numeric: tabular-nums;
}

.as-otp-timer--expired {
    color: var(--as-danger);
}

/* ── 입력 ────────────────────────────────────────────────── */

.as-input {
    padding: 0.52rem 0.8rem;
    border: 1.5px solid #d4d4d4;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--as-text);
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
}

.as-input:focus {
    outline: none;
    border-color: var(--as-primary);
    box-shadow: 0 0 0 3px rgba(74, 109, 167, 0.16);
}

/* ── OTP 6칸 ─────────────────────────────────────────────── */

.as-otp-boxes {
    display: flex;
    gap: 0.4rem;
}

.as-otp-box {
    width: 2.6rem;
    height: 2.6rem;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: inherit;
    color: var(--as-text);
    background: #fff;
    border: 1.5px solid #d4d4d4;
    border-radius: 8px;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
    padding: 0;
    caret-color: var(--as-primary);
}

.as-otp-box:focus {
    outline: none;
    border-color: var(--as-primary);
    box-shadow: 0 0 0 3px rgba(74, 109, 167, 0.16);
}

.as-otp-box.filled {
    border-color: var(--as-primary);
}

.as-otp-box.error {
    border-color: var(--as-danger);
    box-shadow: 0 0 0 3px rgba(194, 71, 71, 0.1);
}

/* ── 버튼 ────────────────────────────────────────────────── */

.as-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.48rem 1rem;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, color 0.15s;
    font-family: inherit;
    white-space: nowrap;
    line-height: 1.2;
    width: fit-content;
}

.as-btn:disabled {
    opacity: 0.46;
    cursor: not-allowed;
}

.as-btn-primary {
    background: var(--as-primary);
    border-color: var(--as-primary);
    color: #fff;
    box-shadow: 0 1px 3px rgba(74, 109, 167, 0.22);
}

.as-btn-primary:hover:not(:disabled) {
    background: var(--as-primary-dark);
    border-color: var(--as-primary-dark);
    box-shadow: 0 2px 7px rgba(74, 109, 167, 0.3);
}

.as-btn-secondary {
    background: transparent;
    border-color: #d4d4d4;
    color: #333333;
}

.as-btn-secondary:hover:not(:disabled) {
    background: #f2f2f2;
    border-color: #bdbdbd;
}

.as-btn-ghost {
    background: transparent;
    border-color: #d4d4d4;
    color: var(--as-muted);
}

.as-btn-ghost:hover:not(:disabled) {
    background: #f2f2f2;
    border-color: #bdbdbd;
    color: var(--as-text);
}

.as-link-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: #333333;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    line-height: 1;
    transition: color 0.15s;
}

.as-link-btn:hover:not(:disabled) {
    color: #111111;
    text-decoration: underline;
}

.as-link-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ── 비밀번호 폼 ─────────────────────────────────────────── */

.as-label {
    display: block;
    font-size: 0.79rem;
    font-weight: 600;
    color: var(--as-muted);
    letter-spacing: 0.01em;
    margin-bottom: 0.3rem;
}

#as-pw-form {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    background: var(--as-surface-soft);
    border: 1px solid var(--as-border);
    border-radius: var(--as-radius);
    padding: 0.9rem 1rem;
    max-width: 22rem;
}

/* ── 비밀번호 기준 ───────────────────────────────────────── */

.as-pw-criteria {
    list-style: none;
    padding: 0;
    margin: 0 0 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
    font-size: 0.76rem;
    color: var(--as-muted);
}

.as-pw-criteria li {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.as-crit-icon {
    font-size: 0.65rem;
    width: 0.75rem;
    flex-shrink: 0;
}

.as-pw-criteria li.met {
    color: var(--as-success);
}

.as-crit-note {
    opacity: 0.7;
}

/* ── 강도 바 ─────────────────────────────────────────────── */

.as-strength-bars {
    display: flex;
    gap: 3px;
    margin-top: 6px;
}

.as-bar {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: #e5e5e5;
    transition: background 0.22s;
}

.as-bar.weak   { background: #e0534a; }
.as-bar.fair   { background: #c9870d; }
.as-bar.good   { background: #2f936f; }
.as-bar.strong { background: #1e7050; }

.as-strength-label {
    font-size: 0.75rem;
    color: var(--as-muted);
    margin-top: 4px;
    min-height: 1.1em;
}

/* ── 폼 액션 ─────────────────────────────────────────────── */

.as-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ── 피드백 ──────────────────────────────────────────────── */

.as-feedback {
    font-size: 0.82rem;
    line-height: 1.65;
}

.as-feedback:empty {
    display: none;
}

.as-feedback--error   { color: var(--as-danger); }
.as-feedback--success { color: var(--as-success); }

/* ── 다크모드 ─────────────────────────────────────────────── */

[data-theme="dark"] .as-section {
    --as-border:       #2a2a2a;
    --as-surface-soft: #1a1a1a;
    --as-ok-bg:        #12302a;
    --as-ok-text:      #5abf8a;
    --as-warn-bg:      #2e2200;
    --as-warn-text:    #d4a830;
}

[data-theme="dark"] .as-row + .as-row {
    border-top-color: #252525;
}

[data-theme="dark"] .as-row-label {
    color: #c2c2c2;
}

[data-theme="dark"] .as-input,
[data-theme="dark"] .as-otp-box {
    background: #1d1d1d;
    border-color: #303030;
    color: #e5e5e5;
}

[data-theme="dark"] .as-input:focus,
[data-theme="dark"] .as-otp-box:focus {
    border-color: #5a7aaa;
    box-shadow: 0 0 0 3px rgba(90, 122, 170, 0.2);
}

[data-theme="dark"] .as-otp-box.filled {
    border-color: #5a7aaa;
}

[data-theme="dark"] #as-otp-area,
[data-theme="dark"] #as-pw-form {
    background: #161616;
    border-color: #2a2a2a;
}

[data-theme="dark"] .as-method-tag {
    background: #1f1f1f;
    border-color: #333333;
    color: #d4d4d4;
}

[data-theme="dark"] .as-bar {
    background: #333333;
}

[data-theme="dark"] .as-strength-label,
[data-theme="dark"] .as-muted {
    color: #a3a3a3;
}

[data-theme="dark"] .as-btn-primary {
    background: #3a5a8a;
    border-color: #3a5a8a;
    box-shadow: none;
}

[data-theme="dark"] .as-btn-primary:hover:not(:disabled) {
    background: #2e4a72;
    border-color: #2e4a72;
}

[data-theme="dark"] .as-btn-secondary {
    background: transparent;
    border-color: #3a3a3a;
    color: #e5e5e5;
}

[data-theme="dark"] .as-btn-secondary:hover:not(:disabled) {
    background: #242424;
    border-color: #4a4a4a;
}

[data-theme="dark"] .as-btn-ghost {
    background: transparent;
    border-color: #3a3a3a;
    color: #c2c2c2;
}

[data-theme="dark"] .as-btn-ghost:hover:not(:disabled) {
    background: #242424;
    border-color: #4a4a4a;
    color: #e5e5e5;
}

[data-theme="dark"] .as-link-btn {
    color: #d4d4d4;
}

[data-theme="dark"] .as-link-btn:hover:not(:disabled) {
    color: #ffffff;
}

[data-theme="dark"] .as-otp-timer {
    color: #a3a3a3;
}

[data-theme="dark"] .as-label {
    color: #c2c2c2;
}

[data-theme="dark"] .as-pw-criteria li.met {
    color: #5abf8a;
}

/* ── 반응형 ──────────────────────────────────────────────── */

@media (max-width: 480px) {
    .as-row {
        grid-template-columns: 5.5rem 1fr;
        gap: 0.5rem 0.75rem;
    }

    #as-otp-input.as-input {
        width: 100%;
        letter-spacing: 0.15em;
    }

    #as-pw-form {
        max-width: 100%;
    }
}
