/* ========================================
   EyeChartPro - Login Page Styles
   세련된 로그인 페이지 스타일
   ======================================== */

/* ========================================
   Base Styles
   ======================================== */
.login-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: var(--font-family);
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.login-container {
    display: flex;
    min-height: 100vh;
}

/* ========================================
   Branding Section (Left)
   ======================================== */
.login-branding {
    --brand-bg-1: #091443;
    --brand-bg-2: #1234a8;
    --brand-bg-3: #2d67ff;
    --brand-glow-cyan: rgba(52, 211, 255, 0.35);
    --brand-glow-indigo: rgba(129, 140, 248, 0.34);
    --brand-glow-mint: rgba(45, 212, 191, 0.24);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(120% 120% at 16% 16%, rgba(56, 189, 248, 0.26) 0%, rgba(56, 189, 248, 0) 56%),
        radial-gradient(120% 120% at 82% 84%, rgba(59, 130, 246, 0.28) 0%, rgba(59, 130, 246, 0) 58%),
        linear-gradient(140deg, var(--brand-bg-1) 0%, var(--brand-bg-2) 48%, var(--brand-bg-3) 100%);
}

.login-branding::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 64px),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 64px);
    -webkit-mask-image: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.9) 0%, transparent 78%);
    mask-image: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.9) 0%, transparent 78%);
    opacity: 0.36;
    pointer-events: none;
}

.login-branding::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 46%, rgba(255, 255, 255, 0.14) 0%, transparent 52%);
    opacity: 0.5;
    animation: auraBreath 8s ease-in-out infinite;
    pointer-events: none;
}

.branding-content {
    position: relative;
    z-index: 3;
    color: #fff;
    text-align: center;
    width: min(500px, 100%);
    padding: 52px 48px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.07) 45%, rgba(255, 255, 255, 0.03) 100%);
    box-shadow:
        0 30px 70px rgba(4, 10, 34, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    animation: panelFloat 8s ease-in-out infinite;
}

.logo-area {
    margin-bottom: 24px;
}

.logo-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    overflow: hidden;
}

.logo-eye-image {
    width: 100%;
    height: 100%;
    border-radius: 0;
    object-fit: cover;
    display: block;
    transform: scale(2.2);
    transform-origin: 50% 50%;
}

.logo-text {
    font-size: 42px;
    font-weight: 750;
    letter-spacing: -0.8px;
    margin: 0;
    background: linear-gradient(110deg, #ffffff 0%, #dbeafe 58%, #bfdbfe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 17px;
    color: rgba(236, 244, 255, 0.86);
    margin-bottom: 42px;
    font-weight: 500;
    letter-spacing: -0.1px;
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: left;
    max-width: 270px;
    margin: 0 auto;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: -0.1px;
}

.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1px solid rgba(134, 239, 172, 0.45);
    background: rgba(16, 185, 129, 0.18);
    border-radius: 50%;
    font-size: 12px;
    color: #86efac;
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.34);
}

/* Decorative Visual - Modern Orbital Animation */
.branding-visual {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.visual-circles {
    position: relative;
    width: 100%;
    height: 100%;
}

.visual-grid {
    position: absolute;
    inset: -16% -8%;
    opacity: 0.2;
    background:
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.08) 0 4px, transparent 5px),
        repeating-radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 60px);
    -webkit-mask-image: radial-gradient(circle at 50% 48%, rgba(0, 0, 0, 0.85) 0%, transparent 72%);
    mask-image: radial-gradient(circle at 50% 48%, rgba(0, 0, 0, 0.85) 0%, transparent 72%);
    animation: gridRotate 28s linear infinite;
}

.aurora {
    position: absolute;
    border-radius: 50%;
    filter: blur(68px);
    mix-blend-mode: screen;
    opacity: 0.7;
}

.aurora-1 {
    width: 380px;
    height: 380px;
    top: -120px;
    right: -60px;
    background: var(--brand-glow-indigo);
    animation: auroraDriftOne 18s ease-in-out infinite;
}

.aurora-2 {
    width: 320px;
    height: 320px;
    bottom: -90px;
    left: -80px;
    background: var(--brand-glow-cyan);
    animation: auroraDriftTwo 16s ease-in-out infinite;
}

.aurora-3 {
    width: 260px;
    height: 260px;
    top: 42%;
    left: 52%;
    background: var(--brand-glow-mint);
    animation: auroraDriftThree 15s ease-in-out infinite;
}

.orbital-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.ring-1 {
    width: 330px;
    height: 330px;
    animation: ringPulse 6s ease-in-out infinite;
}

.ring-2 {
    width: 430px;
    height: 430px;
    border-color: rgba(191, 219, 254, 0.26);
    animation: ringPulse 6s ease-in-out infinite 1.5s;
}

.ring-3 {
    width: 540px;
    height: 540px;
    border-color: rgba(147, 197, 253, 0.18);
    animation: ringPulse 6s ease-in-out infinite 3s;
}

.orbit-track {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    border: 1px dashed rgba(255, 255, 255, 0.18);
    transform-origin: center;
}

.orbit-track::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 100%;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle at 30% 30%, #ffffff 0 20%, #7dd3fc 40%, #1d4ed8 100%);
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.72);
}

.orbit-track-1 {
    width: 280px;
    height: 280px;
    margin-left: -140px;
    margin-top: -140px;
    animation: orbitSpin 11s linear infinite;
}

.orbit-track-2 {
    width: 360px;
    height: 360px;
    margin-left: -180px;
    margin-top: -180px;
    animation: orbitSpinReverse 15s linear infinite;
}

.orbit-track-3 {
    width: 460px;
    height: 460px;
    margin-left: -230px;
    margin-top: -230px;
    border-color: rgba(191, 219, 254, 0.16);
    animation: orbitSpin 22s linear infinite;
}

.spark {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 0 8px rgba(147, 197, 253, 0.7);
    animation: twinkle 4s ease-in-out infinite;
}

.spark-1 {
    top: 18%;
    left: 24%;
}

.spark-2 {
    top: 28%;
    right: 18%;
    animation-delay: 0.6s;
}

.spark-3 {
    top: 44%;
    left: 12%;
    animation-delay: 1.2s;
}

.spark-4 {
    top: 58%;
    right: 14%;
    animation-delay: 1.8s;
}

.spark-5 {
    top: 78%;
    left: 24%;
    animation-delay: 2.4s;
}

.spark-6 {
    top: 84%;
    right: 28%;
    animation-delay: 3s;
}

/* ========================================
   Keyframe Animations
   ======================================== */
@keyframes auraBreath {
    0%, 100% {
        opacity: 0.34;
        transform: scale(1);
    }
    50% {
        opacity: 0.58;
        transform: scale(1.05);
    }
}

@keyframes panelFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes gridRotate {
    0% {
        transform: rotate(0deg) scale(1);
    }
    100% {
        transform: rotate(360deg) scale(1.05);
    }
}

@keyframes auroraDriftOne {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(-18px, 20px) scale(1.07);
    }
}

@keyframes auroraDriftTwo {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(24px, -18px) scale(1.1);
    }
}

@keyframes auroraDriftThree {
    0%, 100% {
        transform: translate(0, 0) scale(0.95);
    }
    50% {
        transform: translate(-16px, -12px) scale(1.08);
    }
}

@keyframes ringPulse {
    0%, 100% {
        opacity: 0.4;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.88;
        transform: translate(-50%, -50%) scale(1.03);
    }
}

@keyframes orbitSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes orbitSpinReverse {
    from {
        transform: rotate(360deg);
    }
    to {
        transform: rotate(0deg);
    }
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.28;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.25);
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-branding::after,
    .login-branding .branding-content,
    .login-branding .logo-icon,
    .login-branding .logo-eye-image,
    .login-branding .visual-grid,
    .login-branding .aurora,
    .login-branding .orbital-ring,
    .login-branding .orbit-track,
    .login-branding .spark {
        animation: none !important;
    }
}

/* ========================================
   Form Section (Right)
   ======================================== */
.login-form-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px;
    background: #fff;
    position: relative;
}

.login-form-wrapper {
    width: 100%;
    max-width: 400px;
}

.form-header {
    margin-bottom: 40px;
    text-align: center;
}

.form-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 8px 0;
}

.clinic-name {
    font-size: 14px;
    color: var(--color-text-muted);
    margin: 0;
}

/* ========================================
   Form Elements
   ======================================== */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
}

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

.input-icon {
    position: absolute;
    left: 16px;
    font-size: 16px;
    opacity: 0.6;
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 48px 14px 48px;
    font-size: 14px;
    border: 2px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-bg-gray-lighter);
    transition: all 0.2s ease;
    font-family: inherit;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--color-blue-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.1);
}

.input-wrapper input::placeholder {
    color: var(--color-text-light);
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.toggle-password:hover {
    opacity: 1;
}

/* ========================================
   접속 모드 셀렉트
   ======================================== */
.input-wrapper select {
    width: 100%;
    padding: 14px 48px 14px 48px;
    font-size: 14px;
    border: 2px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-bg-gray-lighter);
    transition: all 0.2s ease;
    font-family: inherit;
    color: var(--color-text);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.input-wrapper select:focus,
.input-wrapper select:focus-visible {
    outline: none;
    border-color: var(--color-blue-primary);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.1);
}

/* ========================================
   Form Options
   ======================================== */
.form-options {
    display: flex;
    align-items: center;
    margin-top: -8px;
    gap: 12px;
}

.form-options .forgot-link {
    margin-left: auto;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--color-text-secondary);
}

.checkbox-wrapper input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--color-border-medium);
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-wrapper input:checked + .checkmark {
    background: var(--color-blue-primary);
    border-color: var(--color-blue-primary);
}

.checkbox-wrapper input:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.forgot-link {
    font-size: 13px;
    color: var(--color-blue-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.forgot-link:hover {
    color: var(--color-blue-hover);
    text-decoration: underline;
}

/* ========================================
   Login Button
   ======================================== */
.login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--color-blue-primary) 0%, var(--color-blue-hover) 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
    margin-top: 8px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 58, 138, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

.btn-arrow {
    font-size: 18px;
    transition: transform 0.2s ease;
}

.login-btn:hover .btn-arrow {
    transform: translateX(4px);
}

.login-btn.is-loading,
.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

.login-message {
    min-height: 20px;
    margin: 12px 2px 0;
    font-size: 13px;
    line-height: 1.4;
    color: transparent;
}

.login-message.is-error {
    color: #dc2626;
}

.login-message.is-info {
    color: #2563eb;
}

/* ========================================
   Form Footer
   ======================================== */
.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border-light);
}

.pc-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pc-label {
    font-size: 12px;
    color: var(--color-text-light);
}

.pc-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    background: var(--color-bg-gray);
    padding: 4px 8px;
    border-radius: 4px;
}

.update-link a {
    font-size: 12px;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.update-link a:hover {
    color: var(--color-blue-primary);
}

/* ========================================
   Page Footer
   ======================================== */
.login-footer {
    position: absolute;
    bottom: 24px;
    left: 0;
    right: 0;
    text-align: center;
}

.login-footer p {
    font-size: 12px;
    color: var(--color-text-light);
    margin: 0;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1024px) {
    .login-container {
        flex-direction: column;
    }

    .login-branding {
        padding: 40px;
        min-height: 300px;
    }

    .branding-content {
        width: min(620px, 100%);
        padding: 38px 34px;
        border-radius: 24px;
    }

    .logo-icon {
        width: 68px;
        height: 68px;
    }

    .logo-text {
        font-size: 32px;
    }

    .tagline {
        margin-bottom: 24px;
    }

    .feature-list {
        display: none;
    }

    .ring-3,
    .orbit-track-3,
    .visual-grid,
    .spark-5,
    .spark-6 {
        display: none;
    }

    .login-form-section {
        padding: 40px 24px;
    }
}

/* 모바일 전용 — 1024px 규칙을 확실히 오버라이드 */
@media (max-width: 1024px) and (max-height: 900px) and (orientation: portrait) {
    .login-branding {
        padding: 16px;
        min-height: 0;
    }

    .branding-content {
        padding: 16px 20px;
        transform: scale(0.9);
        transform-origin: center center;
    }

    .login-form-section {
        padding: 4px 24px 40px;
    }

    .form-header {
        margin-bottom: 4px;
    }

    .login-form {
        gap: 5px;
    }

    .form-group {
        gap: 2px;
    }

    .form-options {
        margin-top: 4px;
        margin-bottom: 8px;
    }
}

@media (max-width: 768px) {
    /* 브랜딩 영역 높이 24% 축소 (폰트/아이콘 유지) */
    .login-branding {
        padding: 16px;
        min-height: 0;
    }

    .branding-content {
        padding: 16px 20px;
        transform: scale(0.9);
        transform-origin: center center;
    }

    /* 노란색: 브랜딩↔폼 섹션 상단 여백 80% 축소 */
    .login-form-section {
        padding: 4px 24px 40px; /* 60px → 4px (상단) */
    }

    .form-header {
        margin-bottom: 4px;
    }

    /* 폼 요소 간 간격 80% 축소 */
    .login-form {
        gap: 5px;
    }

    .form-group {
        gap: 2px;
    }

    /* 초록색: 체크박스↔로그인 버튼 사이 간격 생성 */
    .form-options {
        margin-top: 4px;
        margin-bottom: 8px;
    }
}

@media (max-width: 480px) {
    .login-branding {
        padding: 20px 24px;
        min-height: 100px;
    }

    .branding-content {
        padding: 20px 22px;
        border-radius: 20px;
    }

    .logo-icon {
        width: 58px;
        height: 58px;
        margin-bottom: 8px;
    }

    .logo-text {
        font-size: 28px;
    }

    .tagline {
        font-size: 15px;
    }

    .ring-2,
    .orbit-track-2,
    .aurora-3,
    .spark {
        display: none;
    }
    
    .form-header h2 {
        font-size: 24px;
    }
    
    .input-wrapper input {
        padding: 12px 44px 12px 44px;
    }
    
    .login-btn {
        padding: 14px 24px;
    }
}

/* ========================================
   비밀번호 변경 모달 (로그인 페이지 전용)
   - components.css 미로드 → 레이어팝업 스타일 자체 정의
   ======================================== */
.pw-login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  -webkit-backdrop-filter: blur(1px);
  backdrop-filter: blur(1px);
  animation: pwFadeIn 0.15s ease-out;
}

@keyframes pwFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.pw-login-dialog {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  width: 420px;
  max-width: 90vw;
  overflow: hidden;
  border: 1px solid #6b7280;
}

.pw-login-header {
  background: linear-gradient(to right, #2563eb, #1e40af);
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
}

.pw-login-title {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pw-login-close-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  width: 20px;
  height: 20px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.pw-login-close-btn:hover {
  color: #fff;
}

.pw-login-body {
  padding: 20px;
}

.pw-login-group {
  margin-bottom: 12px;
}

.pw-login-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
}

.pw-login-input {
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  border: 2px solid #e5e7eb;
  border-radius: 6px;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.pw-login-input:focus,
.pw-login-input:focus-visible {
  border-color: #2563eb;
  outline: none;
}

.pw-login-error {
  min-height: 18px;
  font-size: 13px;
  color: #dc2626;
  margin: 4px 0 0;
}

.pw-login-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 20px 16px;
}

.pw-login-btn {
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease;
}

.pw-login-btn--cancel {
  background: #fff;
  color: #374151;
}

.pw-login-btn--cancel:hover {
  background: #f3f4f6;
}

.pw-login-btn--submit {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.pw-login-btn--submit:hover {
  background: #1d4ed8;
}
