/* ================================================
   Modern Login Design System
   ================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Sans+KR:wght@300;400;500;700&display=swap');

:root {
    --lm-primary:        #3b82f6;
    --lm-primary-dark:   #2563eb;
    --lm-secondary:      #6366f1;
    --lm-background:     #0f172a;
    --lm-surface:        #1e293b;
    --lm-surface-2:      #0f172a;
    --lm-border:         #334155;
    --lm-hover:          #2d3f56;
    --lm-text-primary:   #f8fafc;
    --lm-text-secondary: #94a3b8;
    --lm-text-muted:     #64748b;
    --lm-danger:         #ef4444;
    --lm-success:        #22c55e;
    --lm-warning:        #f59e0b;
    --lm-input-bg:       #0f172a;
    --lm-input-border:   #334155;
    --lm-input-focus:    #3b82f6;
    --lm-shadow:         0 25px 50px -12px rgba(0,0,0,0.6);
    --lm-radius:         14px;
    --lm-radius-sm:      10px;
    --lm-font:           'Inter','Noto Sans KR',sans-serif;
}

/* ================================================
   Full-Screen Layout Base
   ================================================ */
.lm-fullscreen {
    min-height: 100vh;
    width: 100%;
    background: var(--lm-background);
    font-family: var(--lm-font);
}

/* ================================================
   Login Selector Page
   ================================================ */
.lm-selector-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--lm-background);
    font-family: var(--lm-font);
    position: relative;
    overflow: hidden;
}

.lm-selector-page::before {
    content: '';
    position: absolute;
    top: -300px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(59,130,246,0.08) 0%, transparent 65%);
    pointer-events: none;
}

.lm-selector-card {
    background: var(--lm-surface);
    border: 1px solid var(--lm-border);
    border-radius: 20px;
    padding: 3rem 2.5rem 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--lm-shadow);
    position: relative;
    z-index: 1;
}

.lm-selector-logo {
    text-align: center;
    margin-bottom: 2.5rem;
}

.lm-selector-logo-img {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    object-fit: cover;
    margin-bottom: 1rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.lm-selector-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--lm-text-primary);
    margin: 0 0 0.375rem;
    letter-spacing: -0.5px;
}

.lm-selector-subtitle {
    font-size: 0.875rem;
    color: var(--lm-text-secondary);
    margin: 0;
}

.lm-selector-options {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    margin-bottom: 1.75rem;
}

.lm-selector-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.125rem 1.25rem;
    background: var(--lm-surface-2);
    border: 1.5px solid var(--lm-border);
    border-radius: var(--lm-radius);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    text-align: left;
    width: 100%;
}

.lm-selector-btn:hover {
    border-color: var(--lm-primary);
    background: rgba(59,130,246,0.05);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59,130,246,0.12);
}

.lm-selector-btn-icon {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.lm-selector-btn-legacy .lm-selector-btn-icon {
    background: rgba(148,163,184,0.1);
    color: var(--lm-text-secondary);
}

.lm-selector-btn-modern .lm-selector-btn-icon {
    background: rgba(59,130,246,0.15);
    color: var(--lm-primary);
}

.lm-selector-btn-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.lm-selector-btn-label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--lm-text-primary);
    display: block;
}

.lm-selector-btn-desc {
    font-size: 0.8rem;
    color: var(--lm-text-secondary);
    display: block;
}

.lm-selector-btn-arrow {
    color: var(--lm-text-muted);
    font-size: 0.875rem;
    flex-shrink: 0;
    transition: transform 0.2s ease, color 0.2s ease;
}

.lm-selector-btn:hover .lm-selector-btn-arrow {
    transform: translateX(4px);
    color: var(--lm-primary);
}

.lm-selector-footer {
    text-align: center;
    font-size: 0.8rem;
    color: var(--lm-text-muted);
    padding-top: 1.5rem;
    border-top: 1px solid var(--lm-border);
}

/* ================================================
   Modern Login Page — Split Layout
   ================================================ */
.lm-page {
    display: flex;
    min-height: 100vh;
    width: 100%;
    font-family: var(--lm-font);
}

/* ---- Left branding panel ---- */
.lm-brand {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 3.5rem 4rem;
    background: linear-gradient(145deg, #0c1829 0%, #0f2444 50%, #111827 100%);
    position: relative;
    overflow: hidden;
}

.lm-brand::before {
    content: '';
    position: absolute;
    top: -220px;
    left: -180px;
    width: 640px;
    height: 640px;
    background: radial-gradient(circle, rgba(59,130,246,0.14) 0%, transparent 68%);
    pointer-events: none;
}

.lm-brand::after {
    content: '';
    position: absolute;
    bottom: -200px;
    right: -150px;
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, rgba(99,102,241,0.1) 0%, transparent 68%);
    pointer-events: none;
}

.lm-brand-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-bottom: auto;
    position: relative;
    z-index: 1;
}

.lm-brand-header img {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}

.lm-brand-name {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--lm-text-primary);
    letter-spacing: -0.3px;
}

.lm-brand-body {
    position: relative;
    z-index: 1;
    margin-top: auto;
    padding-bottom: 1rem;
}

.lm-brand-headline {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 700;
    color: var(--lm-text-primary);
    line-height: 1.22;
    margin: 0 0 1.25rem;
    letter-spacing: -0.8px;
}

.lm-brand-headline em {
    font-style: normal;
    background: linear-gradient(135deg, #60a5fa, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lm-brand-desc {
    font-size: 0.9375rem;
    color: var(--lm-text-secondary);
    line-height: 1.75;
    max-width: 380px;
    margin-bottom: 2.5rem;
}

.lm-brand-badges {
    display: flex;
    gap: 0.625rem;
    flex-wrap: wrap;
}

.lm-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.375rem 0.875rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 100px;
    font-size: 0.8125rem;
    color: var(--lm-text-secondary);
}

.lm-brand-badge i {
    color: var(--lm-primary);
}

/* ---- Right login panel ---- */
.lm-panel {
    width: 460px;
    min-width: 460px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 3.25rem;
    background: var(--lm-surface);
    border-left: 1px solid var(--lm-border);
    position: relative;
}

.lm-panel-scroll {
    max-height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
}

.lm-panel-scroll::-webkit-scrollbar { width: 0; }

.lm-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: none;
    border: none;
    color: var(--lm-text-secondary);
    font-size: 0.8125rem;
    font-family: var(--lm-font);
    cursor: pointer;
    padding: 0;
    margin-bottom: 2.5rem;
    transition: color 0.2s ease;
}

.lm-back:hover { color: var(--lm-text-primary); }

.lm-panel-header {
    margin-bottom: 1.875rem;
}

.lm-panel-title {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--lm-text-primary);
    margin: 0 0 0.5rem;
    letter-spacing: -0.5px;
}

.lm-panel-subtitle {
    font-size: 0.875rem;
    color: var(--lm-text-secondary);
    margin: 0;
    line-height: 1.55;
}

/* ---- Form Elements ---- */
.lm-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.875rem;
}

.lm-field:last-of-type { margin-bottom: 0; }

.lm-field-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--lm-text-secondary);
    letter-spacing: 0.2px;
}

.lm-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--lm-input-bg);
    border: 1.5px solid var(--lm-input-border);
    border-radius: var(--lm-radius-sm);
    color: var(--lm-text-primary);
    font-size: 0.9375rem;
    font-family: var(--lm-font);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
}

.lm-input::placeholder { color: var(--lm-text-muted); }

.lm-input:focus {
    border-color: var(--lm-input-focus);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.18);
}

.lm-input:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.lm-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.lm-input-wrap .lm-input { padding-right: 5.5rem; }

.lm-timer {
    position: absolute;
    right: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    background: rgba(245,158,11,0.12);
    border: 1px solid rgba(245,158,11,0.3);
    border-radius: 100px;
    color: #fbbf24;
    font-size: 0.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

/* ---- Buttons ---- */
.lm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.8125rem 1rem;
    border-radius: var(--lm-radius-sm);
    font-size: 0.9375rem;
    font-family: var(--lm-font);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    width: 100%;
    letter-spacing: 0.1px;
    margin-top: 0.25rem;
}

.lm-btn-primary {
    background: linear-gradient(135deg, var(--lm-primary), var(--lm-secondary));
    color: #fff;
}

.lm-btn-primary:hover:not(:disabled) {
    opacity: 0.88;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(59,130,246,0.35);
}

.lm-btn-primary:active:not(:disabled) { transform: none; }

.lm-btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.lm-btn-outline {
    background: rgba(148,163,184,0.08);
    border: 1.5px solid var(--lm-border);
    color: var(--lm-text-secondary);
}

.lm-btn-outline:hover {
    background: rgba(148,163,184,0.14);
    color: var(--lm-text-primary);
    border-color: var(--lm-text-muted);
}

.lm-btn-warning-outline {
    background: rgba(245,158,11,0.08);
    border: 1.5px solid rgba(245,158,11,0.3);
    color: #fbbf24;
    flex: 1;
}

.lm-btn-warning-outline:hover {
    background: rgba(245,158,11,0.14);
}

.lm-btn-row {
    display: flex;
    gap: 0.625rem;
    margin-top: 0.25rem;
}

.lm-btn-row .lm-btn { flex: 1; }

.lm-spinner {
    display: inline-block;
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lm-spin 0.65s linear infinite;
    flex-shrink: 0;
}

@keyframes lm-spin { to { transform: rotate(360deg); } }

/* ---- Messages ---- */
.lm-msg {
    padding: 0.75rem 1rem;
    border-radius: var(--lm-radius-sm);
    font-size: 0.875rem;
    line-height: 1.55;
    margin-top: 0.625rem;
}

.lm-msg-error {
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.22);
    color: #fca5a5;
}

.lm-msg-info {
    background: rgba(59,130,246,0.08);
    border: 1px solid rgba(59,130,246,0.22);
    color: #93c5fd;
}

.lm-msg-hint {
    background: rgba(99,102,241,0.07);
    border: 1px solid rgba(99,102,241,0.18);
    color: #a5b4fc;
    text-align: center;
}

.lm-msg-success {
    background: rgba(34,197,94,0.08);
    border: 1px solid rgba(34,197,94,0.22);
    color: #86efac;
}

/* ---- Auth Section ---- */
.lm-auth-divider {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin: 1.5rem 0 1.25rem;
    color: var(--lm-text-muted);
    font-size: 0.8125rem;
}

.lm-auth-divider::before,
.lm-auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--lm-border);
}

.lm-auth-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--lm-text-secondary);
    margin-bottom: 1rem;
}

/* ---- Remember ID ---- */
.lm-remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.875rem;
    font-size: 0.85rem;
    color: var(--lm-text-secondary);
    cursor: pointer;
    user-select: none;
    width: fit-content;
}

.lm-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--lm-primary);
    cursor: pointer;
}

.lm-remember:hover { color: var(--lm-text-primary); }

/* ---- Footer link ---- */
.lm-panel-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.lm-link {
    color: var(--lm-primary);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: opacity 0.2s;
}

.lm-link:hover { opacity: 0.75; text-decoration: underline; }

/* ================================================
   Responsive
   ================================================ */
@media (max-width: 900px) {
    .lm-brand { display: none; }

    .lm-panel {
        width: 100%;
        min-width: unset;
        border-left: none;
        padding: 2.5rem 1.75rem;
    }

    .lm-page { justify-content: center; }
}

@media (max-width: 480px) {
    .lm-panel { padding: 2rem 1.25rem; }
    .lm-selector-card { padding: 2.25rem 1.5rem 2rem; }
    .lm-selector-title { font-size: 1.5rem; }
}
