/* Login Screen Styles */
:root {
  --login-bg: #070d19;
  --card-bg: #0f172a;
  --card-border: rgba(30, 41, 59, 0.8);
  --tx-primary: #f8fafc;
  --tx-muted: #94a3b8;
  --tx-label: #cbd5e1;
  --input-bg: #1e293b;
  --input-border: #64748b;
  --focus-ring: #0ea5e9;
  --accent-cyan: #06b6d4;
  --btn-grad-start: #0f766e;
  --btn-grad-end: #1d4ed8;
  --btn-hover-start: #115e59;
  --btn-hover-end: #1e40af;
  --error-bg: rgba(239, 68, 68, 0.12);
  --error-border: #ef4444;
  --error-text: #fca5a5;
}

#login-screen.login-wrapper {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: var(--login-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: calc(16px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
  overflow-y: auto;
  box-sizing: border-box;
}

.login-grid-bg {
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(circle at 50% 30%, rgba(6, 182, 212, 0.08) 0%, transparent 60%),
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 32px 32px, 32px 32px;
  pointer-events: none;
}

.login-card-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  margin: auto;
}

.login-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 32px 24px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

.login-badge-img {
  display: block;
  width: clamp(112px, 24vh, 200px);
  height: clamp(112px, 24vh, 200px);
  max-width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  margin: 0 auto 16px auto;
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--tx-primary);
  margin: 0 0 8px 0;
  text-align: center;
  line-height: 1.2;
}

.login-sub-text {
  font-size: 13px;
  color: var(--tx-muted);
  margin: 0 0 24px 0;
  text-align: center;
  line-height: 1.4;
}

.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-error-alert {
  background-color: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-text);
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  line-height: 1.4;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.login-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--tx-label);
}

.login-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  color: var(--tx-primary);
  font-size: 14px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-input::placeholder {
  color: #64748b;
}

.login-input:focus-visible {
  border-color: var(--focus-ring);
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input {
  padding-right: 44px;
}

.password-toggle-btn {
  position: absolute;
  right: 6px;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--tx-muted);
  cursor: pointer;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.password-toggle-btn:hover {
  color: var(--tx-primary);
}

.password-toggle-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.login-submit-btn {
  width: 100%;
  height: 44px;
  min-height: 44px;
  margin-top: 8px;
  background: linear-gradient(135deg, var(--btn-grad-start), var(--btn-grad-end));
  border: none;
  border-radius: 6px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.login-submit-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--btn-hover-start), var(--btn-hover-end));
}

.login-submit-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.login-submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
  .login-input, .login-submit-btn {
    transition: none;
  }
}

.login-error-alert:not(.is-visible){display:none;}
.icon-eye-off{display:none;}
