/**
 * IRS Login Page - Premium Insurance System Design
 * Tone: Professional, Trustworthy, Modern
 * Primary: #47429e (Deep Indigo)
 */

/* ============================================
   CSS Variables & Base
   ============================================ */
:root {
  --login-primary: #47429e;
  --login-primary-dark: #2d2968;
  --login-primary-light: #6b65c9;
  --login-accent: #7974c2;
  --login-bg-start: #1a1744;
  --login-bg-end: #2d2968;
  --login-card-bg: rgba(255, 255, 255, 0.97);
  --login-text: #1f1f2e;
  --login-text-muted: #6b7280;
  --login-border: #e5e7eb;
  --login-success: #10b981;
  --login-error: #ef4444;
}

/* ============================================
   Page Layout
   ============================================ */
html.login-html,
html.login-html body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  height: 100%;
}

.login-page {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, var(--login-bg-start) 0%, var(--login-bg-end) 50%, #3d3880 100%);
  position: relative;
  overflow: hidden;
  font-family: 'Wanted Sans Variable', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Animated Background Pattern */
.login-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(107, 101, 201, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(121, 116, 194, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(71, 66, 158, 0.08) 0%, transparent 70%);
  pointer-events: none;
  animation: bgPulse 15s ease-in-out infinite;
}

@keyframes bgPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Geometric Decorations */
.login-page::after {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 600px;
  height: 600px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  pointer-events: none;
  animation: floatSlow 20s ease-in-out infinite;
}

@keyframes floatSlow {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-30px, 30px) rotate(180deg); }
}

/* ============================================
   Main Container
   ============================================ */
.login-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

.login-wrapper {
  display: flex;
  max-width: 1000px;
  width: 100%;
  min-height: 560px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  animation: cardAppear 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardAppear {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ============================================
   Left Panel - Branding
   ============================================ */
.login-brand {
  flex: 1;
  background: linear-gradient(160deg, var(--login-primary-dark) 0%, var(--login-primary) 100%);
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.login-brand::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

/* Decorative circles */
.login-brand .decor-circle {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-brand .decor-circle:nth-child(1) {
  width: 300px;
  height: 300px;
  bottom: -100px;
  left: -100px;
  animation: pulse 8s ease-in-out infinite;
}

.login-brand .decor-circle:nth-child(2) {
  width: 200px;
  height: 200px;
  top: 20%;
  right: -50px;
  animation: pulse 10s ease-in-out infinite reverse;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.1); opacity: 0.5; }
}

.brand-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.brand-logo {
  margin-bottom: 2rem;
}

.brand-logo img {
  height: 48px;
  filter: brightness(0) invert(1);
}

.brand-logo-text {
  font-size: 2.5rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.brand-logo-text span {
  display: block;
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  opacity: 0.8;
  margin-top: 0.5rem;
  text-transform: uppercase;
}

.brand-title {
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.brand-description {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.25rem;
  line-height: 1.6;
  max-width: 320px;
  font-weight: 500;
  margin-top: 1rem;
}

.brand-features {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.brand-feature {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.875rem;
}

.brand-feature-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-feature-icon svg {
  width: 16px;
  height: 16px;
  color: #fff;
}

/* ============================================
   Right Panel - Login Form
   ============================================ */
.login-form-panel {
  flex: 1;
  background: var(--login-card-bg);
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-form-header {
  margin-bottom: 2.5rem;
}

.login-form-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--login-text);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.login-form-subtitle {
  color: var(--login-text-muted);
  font-size: 0.9375rem;
}

/* Form Fields */
.login-form-group {
  margin-bottom: 1.25rem;
}

.login-form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--login-text);
  margin-bottom: 0.5rem;
}

.login-input-wrapper {
  position: relative;
}

.login-input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--login-text-muted);
  pointer-events: none;
  transition: color 0.2s ease;
}

.login-input-icon svg {
  width: 18px;
  height: 18px;
}

.login-input,
.login-page input[type="text"].login-input,
.login-page input[type="password"].login-input {
  width: 100%;
  height: 52px;
  padding: 0 1rem 0 2.75rem;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--login-text);
  background: #f9fafb;
  border: 2px solid var(--login-border);
  border-radius: 12px;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.login-input::placeholder,
.login-page input.login-input::placeholder {
  color: #9ca3af;
  opacity: 1;
}

.login-input:hover,
.login-page input.login-input:hover {
  border-color: #d1d5db;
  background: #fff;
}

.login-input:focus,
.login-page input.login-input:focus {
  border-color: var(--login-primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(71, 66, 158, 0.1);
  outline: none;
}

.login-input:focus + .login-input-icon,
.login-input-wrapper:focus-within .login-input-icon {
  color: var(--login-primary);
}

/* Password visibility toggle */
.login-input-toggle {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--login-text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: color 0.2s ease;
}

.login-input-toggle:hover {
  color: var(--login-primary);
}

.login-input-toggle svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* Remember ID Checkbox */
.login-remember {
  margin-top: 1rem;
}

.login-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.login-checkbox input[type="checkbox"] {
  display: none;
}

.login-checkbox .checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--login-border);
  border-radius: 4px;
  background: #fff;
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.login-checkbox input[type="checkbox"]:checked + .checkmark {
  background: var(--login-primary);
  border-color: var(--login-primary);
}

.login-checkbox input[type="checkbox"]:checked + .checkmark::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.login-checkbox .label-text {
  font-size: 0.875rem;
  color: var(--login-text-muted);
}

.login-checkbox:hover .checkmark {
  border-color: var(--login-primary);
}

/* Submit Button */
.login-submit-btn {
  width: 100%;
  height: 52px;
  margin-top: 1rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, var(--login-primary) 0%, var(--login-primary-dark) 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.login-submit-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--login-primary-light) 0%, var(--login-primary) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.login-submit-btn:hover::before {
  opacity: 1;
}

.login-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgba(71, 66, 158, 0.4);
}

.login-submit-btn:active {
  transform: translateY(0);
}

.login-submit-btn span {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.login-submit-btn svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

.login-submit-btn:hover svg {
  transform: translateX(3px);
}

/* Helper Links */
.login-helper-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--login-border);
}

.login-helper-link {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--login-text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.login-helper-link:hover {
  color: var(--login-primary);
}

.login-helper-link svg {
  width: 14px;
  height: 14px;
}

/* ============================================
   Footer
   ============================================ */
.login-footer {
  position: relative;
  z-index: 1;
  padding: 1.25rem 2rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.75rem;
  line-height: 1.6;
  max-width: 800px;
  margin: 0 auto;
}

.login-footer p {
  margin: 0;
}

.login-footer .login-notice {
  margin-bottom: 1rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.8125rem;
  line-height: 1.9;
  letter-spacing: -0.01em;
}

.login-footer .login-notice strong {
  color: #fff;
  font-weight: 600;
}

.login-footer .login-copyright {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
}

.login-footer a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.2s ease;
}

.login-footer a:hover {
  color: #fff;
}

/* ============================================
   Error States
   ============================================ */
.login-input.error {
  border-color: var(--login-error);
  background: #fef2f2;
}

.login-input.error:focus {
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.login-error-message {
  display: none;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--login-error);
}

.login-error-message.show {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.login-error-message svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Server Error Message (inline, from redirect) */
.login-server-error {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.875rem 1rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border: 1px solid #fecaca;
  border-radius: 10px;
  color: #dc2626;
  font-size: 0.875rem;
  font-weight: 500;
  animation: errorAppear 0.3s ease-out;
}

.login-server-error svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

@keyframes errorAppear {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Loading State
   ============================================ */
.login-submit-btn.loading {
  pointer-events: none;
}

.login-submit-btn.loading span {
  opacity: 0;
}

.login-submit-btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 900px) {
  .login-wrapper {
    flex-direction: column;
    max-width: 440px;
    min-height: auto;
  }

  .login-brand {
    padding: 2rem;
    min-height: auto;
  }

  .brand-title {
    font-size: 1.5rem;
  }

  .brand-features {
    display: none;
  }

  .login-form-panel {
    padding: 2rem;
  }
}

@media (max-width: 480px) {
  .login-container {
    padding: 1rem;
  }

  .login-wrapper {
    border-radius: 20px;
  }

  .login-brand {
    padding: 1.5rem;
  }

  .brand-title {
    font-size: 1.25rem;
  }

  .brand-description {
    font-size: 0.875rem;
  }

  .login-form-panel {
    padding: 1.5rem;
  }

  .login-form-title {
    font-size: 1.5rem;
  }

  .login-input {
    height: 48px;
  }

  .login-submit-btn {
    height: 48px;
  }

  .login-helper-links {
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
  }
}

/* ============================================
   Password Update Page
   ============================================ */
.login-page.pass-update {
  height: auto;
  min-height: 100vh;
  overflow-y: auto;
}

html.login-html.pass-update-html,
html.login-html.pass-update-html body {
  overflow: auto;
}

.pass-update-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  margin: 2rem auto;
  padding: 2.5rem;
  background: var(--login-card-bg);
  border-radius: 20px;
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  animation: cardAppear 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.pass-update-header {
  text-align: center;
  margin-bottom: 2rem;
}

.pass-update-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--login-primary) 0%, var(--login-primary-dark) 100%);
  margin-bottom: 1rem;
}

.pass-update-header-icon svg {
  width: 28px;
  height: 28px;
  color: #fff;
}

.pass-update-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--login-text);
  margin-bottom: 0.375rem;
  letter-spacing: -0.02em;
}

.pass-update-subtitle {
  font-size: 0.875rem;
  color: var(--login-text-muted);
}

.pass-update-notice {
  padding: 1rem 1.25rem;
  margin-bottom: 1.75rem;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fcd34d;
  border-radius: 12px;
  font-size: 0.8125rem;
  line-height: 1.7;
  color: #92400e;
}

.pass-update-notice-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.pass-update-notice-header svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.pass-update-notice p {
  margin: 0.25rem 0;
}

.pass-update-notice strong {
  font-weight: 600;
}

.pass-update-notice a {
  color: #92400e;
  font-weight: 600;
  text-decoration: underline;
}

.pass-update-notice-rule {
  margin-top: 0.625rem;
  padding-top: 0.625rem;
  border-top: 1px solid rgba(146, 64, 14, 0.15);
  font-weight: 500;
  color: #b45309;
}

.pass-update-divider {
  border: none;
  border-top: 1px solid var(--login-border);
  margin: 1.5rem 0;
}

.pass-update-hint {
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: var(--login-text-muted);
}

/* Inline form error (below submit button) */
.pass-update-form-error {
  display: none;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.875rem 1rem;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border: 1px solid #fecaca;
  border-radius: 10px;
  color: #dc2626;
  font-size: 0.8125rem;
  font-weight: 500;
  animation: errorAppear 0.3s ease-out;
}

.pass-update-form-error.show {
  display: flex;
}

.pass-update-form-error svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Responsive */
@media (max-width: 520px) {
  .pass-update-container {
    margin: 1rem;
    padding: 1.75rem;
    border-radius: 16px;
  }

  .pass-update-title {
    font-size: 1.25rem;
  }
}



/* ============================================
   Admin Login 컬러변경  #adminlog으로 cascade
   ============================================ */

#adminlog.login-page{
  background: linear-gradient(135deg, #3890d6 0%, #1a4587 50%, #224db0 100%);
}
  
#adminlog .login-brand {
   background: linear-gradient(160deg, #3b98db 0%, #1e41a9 100%);
}

#adminlog .login-submit-btn {
  background: linear-gradient(135deg, #3890d6 0%, #224db0 100%);
}

#adminlog .login-submit-btn::before {
      background: linear-gradient(135deg, #2a5da4 0%, #378dd3 100%);
}