/* 자율스터디 SSO - 로그인·가입 화면 (가운데 단일 컬럼) */

:root {
    --primary: #1f4fd8;
    --primary-hover: #1a43b8;
    --primary-ring: rgba(31, 79, 216, .18);

    --text: #1f2329;
    --text-sub: #5d636b;
    --text-weak: #8a9099;
    --line: #dde1e6;
    --line-strong: #c4c9d0;
    --bg-soft: #f5f6f8;

    --red: #d93025;
    --red-bg: #fdf2f1;
    --green: #127a46;
    --green-bg: #eef9f2;
    --blue-bg: #eef3fd;

    --radius: 6px;
    --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: #fff;
    word-break: keep-all;
    overflow-wrap: anywhere;
    -webkit-font-smoothing: antialiased;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- 레이아웃 ---------- */

.auth {
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    padding: 72px 16px 40px;
}

/* ---------- 로고 ---------- */

.brand { display: flex; justify-content: center; margin-bottom: 36px; }

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    text-decoration: none;
}

.logo-img { display: block; height: 34px; width: auto; }

.logo-divider { width: 1px; height: 20px; background: var(--line-strong); }

.logo-text { font-size: 17px; font-weight: 500; letter-spacing: -.01em; white-space: nowrap; }
.logo-text b { font-weight: 700; color: var(--primary); }

.page-title {
    margin: -12px 0 20px;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
}

/* ---------- 폼 ---------- */

.form { display: grid; gap: 10px; }

.field { display: grid; gap: 6px; margin-bottom: 6px; }

label { font-size: 13px; font-weight: 600; color: var(--text-sub); }

input[type="text"],
input[type="password"],
input[type="email"] {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    font: inherit;
    font-size: 15px;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: border-color .15s, box-shadow .15s;
}

input::placeholder { color: var(--text-weak); }

input:hover { border-color: var(--line-strong); }

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
}

input.invalid { border-color: var(--red); }
input.invalid:focus { box-shadow: 0 0 0 3px rgba(217, 48, 37, .15); }

.password-wrap { position: relative; }
.password-wrap input { padding-right: 52px; }

.toggle-pw {
    position: absolute;
    top: 50%;
    right: 8px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    color: var(--text-weak);
    background: transparent;
    border: 0;
    border-radius: 50%;
    transform: translateY(-50%);
    cursor: pointer;
}

.toggle-pw:hover { color: var(--text); background: var(--bg-soft); }
.toggle-pw:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

.toggle-pw svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.toggle-pw .icon-eye-off { display: none; }
.toggle-pw[aria-pressed="true"] .icon-eye { display: none; }
.toggle-pw[aria-pressed="true"] .icon-eye-off { display: block; }

.field-error, .caps-warning { margin: 0; font-size: 12px; }
.field-error { color: var(--red); }
.field-error:empty { display: none; }
.caps-warning { margin-top: -4px; color: #b54708; }

.btn-primary {
    height: 50px;
    margin-top: 6px;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    background: var(--primary);
    border: 0;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background .15s;
}

.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-ring); }

/* ---------- 알림 ---------- */

.alert {
    margin: 0 0 14px;
    padding: 12px 14px;
    font-size: 13px;
    border-radius: var(--radius);
}

.alert.error   { color: var(--red); background: var(--red-bg); }
.alert.info    { color: var(--primary); background: var(--blue-bg); }
.alert.success { color: var(--green); background: var(--green-bg); }

/* ---------- 하단 링크 ---------- */

.links {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 20px 0 0;
    font-size: 14px;
    color: var(--text-sub);
}

.links a {
    color: var(--text);
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid var(--text);
}

.links a:hover { color: var(--primary); border-color: var(--primary); }

/* ---------- 연결 서비스 ---------- */

.services { margin-top: 40px; }

.divider-label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
    font-size: 12px;
    color: var(--text-weak);
}

.divider-label::before,
.divider-label::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

.service-list {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.service-list li { width: 64px; }

.svc {
    display: grid;
    justify-items: center;
    gap: 6px;
    color: inherit;
    text-decoration: none;
    border-radius: 12px;
}

a.svc .svc-badge { transition: transform .15s, box-shadow .15s; }
a.svc:hover .svc-badge { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0, 0, 0, .15); }
a.svc:hover .svc-name { color: var(--text); }
a.svc:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; }

.svc.disabled { cursor: default; }
.svc.disabled .svc-badge { opacity: .35; }

.svc-badge {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    border-radius: 12px;
}

.svc-name { font-size: 12px; color: var(--text-sub); white-space: nowrap; }

/* ---------- 바닥글 ---------- */

.foot {
    margin-top: 48px;
    font-size: 12px;
    color: var(--text-weak);
    text-align: center;
}

@media (max-width: 400px) {
    .auth { padding-top: 48px; }
    .service-list { gap: 10px; }
}

.foot a { color: var(--text-sub); text-decoration: none; }
.foot a:hover { color: var(--primary); text-decoration: underline; }
.foot span { margin: 0 6px; }

/* ---------- 동의 화면 ---------- */

.consent-app { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }

.consent-app-badge {
    display: grid;
    place-items: center;
    flex: none;
    width: 52px;
    height: 52px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    background: var(--blue-bg);
    border-radius: 14px;
}

.consent-title { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.4; letter-spacing: -.01em; }
.consent-title b { font-weight: 800; }
.consent-host { margin: 4px 0 0; font-size: 13px; color: var(--text-weak); }

.consent-list {
    margin: 0 0 16px;
    padding: 6px 16px;
    list-style: none;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.consent-list li { display: flex; gap: 12px; padding: 12px 0; }
.consent-list li + li { border-top: 1px solid var(--line); }

.consent-check {
    display: grid;
    place-items: center;
    flex: none;
    width: 22px;
    height: 22px;
    margin-top: 1px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: var(--primary);
    border-radius: 50%;
}

.consent-label { margin: 0; font-size: 15px; font-weight: 600; }
.consent-desc { margin: 2px 0 0; font-size: 13px; color: var(--text-sub); }

.consent-sub { margin: 0 0 8px; font-size: 12px; color: var(--text-weak); }
.consent-list.done { background: var(--bg-soft); }
.consent-list.done .consent-check { background: var(--text-weak); }
.consent-list.done .consent-label { font-size: 14px; font-weight: 500; color: var(--text-sub); }

.consent-note { margin: 0 0 18px; font-size: 13px; line-height: 1.6; color: var(--text-sub); }

.btn-text {
    width: 100%;
    height: 44px;
    margin-top: 8px;
    font: inherit;
    font-size: 15px;
    color: var(--text-sub);
    background: transparent;
    border: 0;
    border-radius: var(--radius);
    cursor: pointer;
}

.btn-text:hover { color: var(--text); background: var(--bg-soft); }

.consent-account { margin: 20px 0 0; font-size: 13px; color: var(--text-weak); text-align: center; }

/* ---------- 비밀번호 찾기 ---------- */

.forgot-desc { margin: 0 0 18px; font-size: 14px; line-height: 1.6; color: var(--text-sub); }
.btn-link { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.links .sep { color: var(--line-strong); }

/* ---------- 동의 화면: 항목 선택 ---------- */

.consent-item { display: flex; gap: 12px; align-items: flex-start; width: 100%; cursor: pointer; }
.consent-item input[type="checkbox"] { flex: none; width: 20px; height: 20px; margin-top: 1px; accent-color: var(--primary); cursor: pointer; }
.consent-item input[disabled] { cursor: default; }
.consent-item > span { display: grid; gap: 2px; }
.consent-item .consent-label { display: flex; align-items: center; gap: 6px; }
.consent-item .consent-desc { margin: 0; }
.consent-tag { padding: 0 6px; font-size: 11px; font-weight: 600; color: var(--text-sub); background: var(--bg-soft); border-radius: 4px; }
.consent-all { margin: 0 0 8px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-soft); }
.consent-item.all .consent-label { font-size: 15px; }
.consent > .btn-primary { width: 100%; }
