/* =====================================================
   GN AuthServer - 로그인 화면 CSS
   디자인: 기업용 인증 포털 / 신뢰감 + 모던
   ===================================================== */

:root {
    --gn-primary:     #1a3a6e;   /* 딥 네이비 */
    --gn-primary-lt:  #2454a0;   /* 미디엄 블루 */
    --gn-accent:      #0071e3;   /* 액션 블루 */
    --gn-accent-hover:#005bb5;
    --gn-success:     #1da462;
    --gn-error:       #d93025;
    --gn-warn:        #e8a020;
    --gn-info:        #0071e3;
    --gn-text:        #1d1d1f;
    --gn-text-2:      #4a4a52;
    --gn-text-3:      #86868b;
    --gn-border:      #d2d2d7;
    --gn-bg:          #f5f5f7;
    --gn-white:       #ffffff;
    --gn-card-shadow: 0 20px 60px rgba(0,0,0,.14), 0 4px 20px rgba(0,0,0,.08);
    --radius:         14px;
    --transition:     0.22s cubic-bezier(.4,0,.2,1);
}

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

html { font-size: 16px; }

body.login-body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #0f1c35;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* ── 배경 장식 ── */
.bg-pattern { position: fixed; inset: 0; pointer-events: none; z-index: 0; }

.bg-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .35;
}
.bg-circle-1 {
    width: 600px; height: 600px;
    background: radial-gradient(circle, #1a3a6e 0%, transparent 70%);
    top: -200px; left: -100px;
}
.bg-circle-2 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, #0071e3 0%, transparent 70%);
    bottom: -150px; right: -100px;
}
.bg-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* ── 메인 컨테이너 ── */
.login-container {
    position: relative; z-index: 1;
    display: flex;
    width: 960px;
    min-height: 580px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 40px 100px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.06);
    animation: fadeUp .5s ease-out;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── 왼쪽 브랜드 패널 ── */
.login-brand {
    flex: 0 0 380px;
    background: linear-gradient(160deg, #1a3a6e 0%, #0d2350 50%, #091730 100%);
    display: flex;
    align-items: center;
    padding: 52px 44px;
    position: relative;
    overflow: hidden;
}
.login-brand::before {
    content: '';
    position: absolute;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(0,113,227,.3) 0%, transparent 70%);
    top: -80px; right: -80px;
    pointer-events: none;
}
.login-brand::after {
    content: '';
    position: absolute;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(26,58,110,.5) 0%, transparent 70%);
    bottom: -60px; left: -60px;
    pointer-events: none;
}

.brand-content {
    position: relative; z-index: 1;
    width: 100%;
}

.brand-logo {
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 52px;
}
.logo-mark {
    width: 52px; height: 52px;
    background: linear-gradient(135deg, #0071e3, #005bb5);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 700; color: #fff;
    letter-spacing: -0.5px;
    box-shadow: 0 8px 24px rgba(0,113,227,.4);
}
.logo-product {
    display: block; font-size: 22px; font-weight: 700; color: #fff;
    letter-spacing: -0.5px; line-height: 1.2;
}
.logo-tagline {
    display: block; font-size: 12px; color: rgba(255,255,255,.55);
    font-weight: 400; margin-top: 2px; letter-spacing: .3px;
}

.brand-desc {
    margin-bottom: 44px;
}
.brand-desc h2 {
    font-size: 28px; font-weight: 700; color: #fff;
    line-height: 1.35; letter-spacing: -.5px; margin-bottom: 16px;
}
.brand-desc p {
    font-size: 14px; color: rgba(255,255,255,.55);
    line-height: 1.7; font-weight: 300;
}

.brand-services {
    display: flex; flex-direction: column; gap: 10px;
}
.service-badge {
    display: flex; align-items: center; gap: 10px;
    font-size: 13px; color: rgba(255,255,255,.75);
    font-weight: 400;
}
.service-dot {
    width: 8px; height: 8px; border-radius: 50%;
    flex-shrink: 0;
}
.dot-mail  { background: #34c759; box-shadow: 0 0 8px rgba(52,199,89,.6); }
.dot-works { background: #0071e3; box-shadow: 0 0 8px rgba(0,113,227,.6); }
.dot-msg   { background: #ff9f0a; box-shadow: 0 0 8px rgba(255,159,10,.6); }

/* ── 오른쪽 폼 패널 ── */
.login-form-wrap {
    flex: 1;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 52px;
}

.login-card {
    width: 100%; max-width: 380px;
}

.login-card-header {
    margin-bottom: 36px;
}
.login-title {
    font-size: 28px; font-weight: 700;
    color: var(--gn-text);
    letter-spacing: -.5px; margin-bottom: 8px;
}
.login-subtitle {
    font-size: 14px; color: var(--gn-text-3); font-weight: 400;
}

/* ── Alert ── */
.alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13.5px; font-weight: 400;
    margin-bottom: 22px;
    animation: slideDown .25s ease;
    position: relative;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.alert-error  { background: #fff0f0; color: #c0392b; border: 1px solid #fccccb; }
.alert-info   { background: #f0f7ff; color: #1558b0; border: 1px solid #b8d4f7; }
.alert-warn   { background: #fffbf0; color: #9a6700; border: 1px solid #f5df99; }
.alert-icon   { font-size: 15px; flex-shrink: 0; margin-top: 1px; }
.alert-close  {
    position: absolute; top: 10px; right: 12px;
    background: none; border: none; cursor: pointer;
    font-size: 18px; color: inherit; opacity: .6; line-height: 1;
    padding: 0;
}
.alert-close:hover { opacity: 1; }

/* ── 폼 요소 ── */
.form-group { margin-bottom: 20px; }

.form-label {
    display: block;
    font-size: 13px; font-weight: 500;
    color: var(--gn-text-2);
    margin-bottom: 7px;
}

.input-wrap {
    position: relative;
    display: flex; align-items: center;
}
.input-icon {
    position: absolute; left: 14px;
    color: var(--gn-text-3);
    pointer-events: none;
    display: flex; align-items: center;
}
.form-input {
    width: 100%; height: 48px;
    padding: 0 44px 0 44px;
    border: 1.5px solid var(--gn-border);
    border-radius: 10px;
    font-size: 14.5px; font-weight: 400;
    color: var(--gn-text);
    background: #fff;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    font-family: inherit;
}
.form-input::placeholder { color: var(--gn-text-3); }
.form-input:focus {
    border-color: var(--gn-accent);
    box-shadow: 0 0 0 3px rgba(0,113,227,.12);
}
.has-error .form-input {
    border-color: var(--gn-error);
    box-shadow: 0 0 0 3px rgba(217,48,37,.1);
}

.pw-toggle {
    position: absolute; right: 12px;
    background: none; border: none; cursor: pointer;
    color: var(--gn-text-3); padding: 6px;
    border-radius: 6px;
    display: flex; align-items: center;
    transition: color var(--transition), background var(--transition);
}
.pw-toggle:hover { color: var(--gn-text-2); background: var(--gn-bg); }
.pw-toggle.active { color: var(--gn-accent); }

.form-error {
    display: block; font-size: 12px;
    color: var(--gn-error); margin-top: 5px;
}

/* ── 옵션 행 ── */
.form-options {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px;
}
.checkbox-label {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer; user-select: none;
}
.checkbox-label input[type=checkbox] { display: none; }
.checkbox-custom {
    width: 18px; height: 18px;
    border: 1.5px solid var(--gn-border);
    border-radius: 5px;
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    transition: background var(--transition), border-color var(--transition);
    flex-shrink: 0;
}
.checkbox-label input:checked + .checkbox-custom {
    background: var(--gn-accent);
    border-color: var(--gn-accent);
}
.checkbox-label input:checked + .checkbox-custom::after {
    content: '';
    width: 10px; height: 6px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translateY(-2px);
}
.checkbox-text { font-size: 13px; color: var(--gn-text-2); }

.link-forgot {
    font-size: 13px; color: var(--gn-accent); text-decoration: none;
    font-weight: 500;
}
.link-forgot:hover { text-decoration: underline; }

/* ── 로그인 버튼 ── */
.btn-login {
    width: 100%; height: 50px;
    background: linear-gradient(135deg, var(--gn-accent), var(--gn-primary-lt));
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px; font-weight: 600;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 4px 16px rgba(0,113,227,.35);
    font-family: inherit;
    letter-spacing: .3px;
}
.btn-login:hover:not(:disabled) {
    opacity: .92;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0,113,227,.45);
}
.btn-login:active:not(:disabled) { transform: translateY(0); }
.btn-login:disabled { opacity: .7; cursor: not-allowed; }

.spin { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 카드 푸터 ── */
.login-card-footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--gn-bg);
    text-align: center;
}
.login-card-footer p {
    font-size: 12px; color: var(--gn-text-3);
    line-height: 1.8;
}
.login-card-footer a {
    color: var(--gn-accent); text-decoration: none;
}
.login-card-footer a:hover { text-decoration: underline; }
.footer-security {
    display: flex; align-items: center; justify-content: center; gap: 5px;
    margin-top: 4px;
}

/* ── 로딩 오버레이 ── */
.loading-overlay {
    position: fixed; inset: 0;
    background: rgba(255,255,255,.7);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(3px);
}
.loading-spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--gn-border);
    border-top-color: var(--gn-accent);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

/* ── 반응형 ── */
@media (max-width: 800px) {
    .login-container {
        flex-direction: column;
        width: 95vw; min-height: unset;
        border-radius: 18px;
    }
    .login-brand {
        flex: none; padding: 32px;
        min-height: 180px;
    }
    .brand-desc h2 { font-size: 22px; }
    .brand-services { flex-direction: row; flex-wrap: wrap; gap: 12px; }
    .login-form-wrap { padding: 36px 28px; }
}
@media (max-width: 480px) {
    .login-form-wrap { padding: 28px 20px; }
    .login-brand { display: none; }
}
