/* ===== LOGIN PAGE STYLES - CLEAN MEDICAL DESIGN ===== */

/* === Base Page === */
.login-page {
  min-height: 100vh;
  display: flex;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0a1628 0%, #0e2a42 40%, #0b3248 70%, #091e30 100%);
}

/* Soft ambient light */
.login-page::after {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  top: 50%;
  left: 25%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(225, 55, 50, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Glance / Shine sweep effect */
.login-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent 0%,
    transparent 30%,
    rgba(255, 255, 255, 0.03) 45%,
    rgba(255, 255, 255, 0.06) 50%,
    rgba(255, 255, 255, 0.03) 55%,
    transparent 70%,
    transparent 100%
  );
  animation: loginGlance 10s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes loginGlance {
  0% { left: -100%; }
  50% { left: 150%; }
  100% { left: 150%; }
}

/* === Pulse Line (SVG-based, between logo and text) === */
.pulse-line-wrapper {
  width: 220px;
  height: 40px;
  margin: var(--spacing-lg) auto;
  position: relative;
  overflow: hidden;
}

.pulse-line-svg {
  width: 100%;
  height: 100%;
}

.pulse-line-path {
  fill: none;
  stroke: rgba(225, 55, 50, 0.9);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 500;
  stroke-dashoffset: 500;
  animation: pulseDraw 3s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(225, 55, 50, 0.6)) drop-shadow(0 0 16px rgba(225, 55, 50, 0.3));
}

@keyframes pulseDraw {
  0% { stroke-dashoffset: 500; opacity: 0.7; }
  40% { opacity: 1; }
  50% { stroke-dashoffset: 0; opacity: 1; }
  90% { opacity: 0.7; }
  100% { stroke-dashoffset: -500; opacity: 0.7; }
}

/* === Floating Pulse Dots === */
.pulse-dots {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.pulse-dot {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(225, 55, 50, 0.2);
  animation: dotDrift 20s ease-in-out infinite;
  pointer-events: none;
}

@keyframes dotDrift {
  0%, 100% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  15% { opacity: 0.4; }
  50% {
    transform: translateY(-60px) translateX(20px);
    opacity: 0.3;
  }
  85% { opacity: 0; }
}

/* === Left Side - Branding === */
.login-left {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  padding: var(--spacing-3xl) var(--spacing-2xl);
}

.illustration-content {
  text-align: center;
  color: var(--pure-white);
  max-width: 480px;
  animation: fadeInUp 0.8s ease-out;
}

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

.zencia-logo-container {
  margin-bottom: var(--spacing-sm);
  position: relative;
}

.zencia-logo-container::after {
  display: none;
}

.zencia-logo-clean {
  max-width: 320px;
  height: auto;
  background: transparent;
  padding: 0;
  border: none;
  transition: transform var(--transition-normal);
}

.zencia-logo-clean:hover {
  transform: scale(1.05);
}

.illustration-text {
  font-size: 1.05rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 1);
  font-weight: var(--font-weight-light);
  letter-spacing: 0.01em;
  margin-bottom: var(--spacing-xl);
}

/* === Medical Stats Ticker === */
.medical-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-lg);
  padding: var(--spacing-lg) var(--spacing-xl);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-xl);
  animation: fadeInUp 1s ease-out 0.3s both;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: var(--font-weight-bold);
  color: #e13732;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: var(--font-weight-medium);
}

.stat-divider {
  width: 1px;
  height: 32px;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.1), transparent);
}

/* === Right Side - Login Form === */
.login-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  padding: var(--spacing-2xl);
}

.login-container {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  padding: var(--spacing-2xl) var(--spacing-2xl);
  box-shadow:
    0 25px 60px -12px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
  animation: cardSlideIn 0.7s ease-out 0.15s both;
}

@keyframes cardSlideIn {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Animated gradient border glow */
.card-border-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    #0e415b,
    #e13732,
    #ff6b47,
    #e13732,
    #0e415b
  );
  background-size: 300% 100%;
  animation: borderGlow 4s ease-in-out infinite;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

@keyframes borderGlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Accent top bar (hidden) */
.login-container::before {
  display: none;
}

/* === Header ECG Mini-line === */
.header-ecg-line {
  width: 120px;
  height: 24px;
  margin: 0 auto var(--spacing-sm);
  opacity: 0.45;
}

.header-ecg-line svg {
  width: 100%;
  height: 100%;
}

.header-ecg-path {
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
  animation: ecgDraw 3s ease-in-out infinite;
  animation-delay: 1.5s;
}

@keyframes ecgDraw {
  0% { stroke-dashoffset: 300; opacity: 0.7; }
  40% { opacity: 1; }
  50% { stroke-dashoffset: 0; opacity: 1; }
  90% { opacity: 0.7; }
  100% { stroke-dashoffset: -300; opacity: 0.7; }
}

.login-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.login-title {
  font-size: 1.75rem;
  color: var(--primary-color);
  margin-bottom: var(--spacing-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.02em;
}

.login-subtitle {
  color: var(--primary-red);
  font-size: 0.82rem;
  font-weight: var(--font-weight-semibold);
  margin-bottom: 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.subtitle-icon {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

/* === Login Form Styles === */
.login-form {
  width: 100%;
}

.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-weight: var(--font-weight-semibold);
  color: var(--primary-dark);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.input-wrapper {
  position: relative;
}

.form-input {
  width: 100%;
  padding: 14px 14px 14px 2.75rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  font-family: var(--font-primary);
  background-color: var(--bg-light);
  transition: all var(--transition-fast);
  color: #0e415b;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(14, 65, 91, 0.1), 0 0 20px rgba(14, 65, 91, 0.05);
  background-color: var(--pure-white);
}

.form-input::placeholder {
  color: #adb5bd;
  font-weight: var(--font-weight-light);
}

.form-input.error {
  border-color: var(--primary-red);
  box-shadow: 0 0 0 4px rgba(225, 55, 50, 0.08);
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 1.15rem;
  height: 1.15rem;
  color: #adb5bd;
  pointer-events: none;
  transition: color var(--transition-fast);
}

.form-input:focus ~ .input-icon,
.form-input:focus + .input-icon {
  color: var(--primary-color);
}

/* === Password Toggle === */
.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #adb5bd;
  cursor: pointer;
  padding: var(--spacing-xs);
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.password-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
}

/* === Form Options === */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.custom-checkbox {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

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

.checkbox-label {
  font-size: 0.82rem;
  color: var(--text-light);
  cursor: pointer;
  user-select: none;
}

.forgot-password {
  color: var(--primary-red);
  font-size: 0.82rem;
  text-decoration: none;
  font-weight: var(--font-weight-semibold);
  transition: all var(--transition-fast);
  position: relative;
}

.forgot-password::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--primary-red);
  transition: width var(--transition-normal);
}

.forgot-password:hover::after {
  width: 100%;
}

.forgot-password:hover {
  color: var(--dark-red);
}

/* === Login Button === */
.login-button {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #0e415b 0%, #0b3248 50%, #0e415b 100%);
  background-size: 200% 200%;
  color: var(--pure-white);
  border: none;
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  font-family: var(--font-primary);
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  box-shadow: 0 4px 15px rgba(14, 65, 91, 0.3);
  animation: btnBgShift 3s ease-in-out infinite;
}

@keyframes btnBgShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.login-button:hover {
  background: linear-gradient(135deg, #0a3547 0%, #0e415b 50%, #0a3547 100%);
  box-shadow: 0 8px 30px rgba(14, 65, 91, 0.4);
  transform: translateY(-2px);
}

.login-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(14, 65, 91, 0.3);
}

.login-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.button-text {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-heart-icon {
  width: 16px;
  height: 16px;
  animation: btnHeartBeat 1.5s ease-in-out infinite;
}

@keyframes btnHeartBeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.2); }
  50% { transform: scale(1); }
}

/* Shine sweep on button */
.login-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transition: left 0.5s;
}

.login-button:hover::before {
  left: 100%;
}

/* === Login Footer === */
.login-footer {
  text-align: center;
  margin-top: var(--spacing-xl);
}

.login-footer p {
  color: var(--text-light);
  font-size: 0.82rem;
  margin-bottom: 0;
}

.login-footer .link {
  color: var(--primary-color);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.login-footer .link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* === Powered by Footer === */
.powered-by-footer {
  position: absolute;
  bottom: var(--spacing-md);
  left: 0;
  right: 0;
  z-index: 2;
  text-align: center;
}

.powered-by-footer p {
  color: rgba(255, 255, 255, 1);
  font-size: 0.8rem;
  margin: 0;
  font-weight: var(--font-weight-normal);
}

.powered-by-footer a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-weight: var(--font-weight-bold);
  transition: all var(--transition-fast);
}

.powered-by-footer a:hover {
  color: var(--pure-white);
  text-decoration: underline;
}

/* === Error Message === */
.error-message {
  background: var(--light-red);
  color: var(--dark-red);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary-red);
  margin-bottom: var(--spacing-lg);
  font-size: 0.82rem;
  font-weight: var(--font-weight-medium);
  box-shadow: var(--shadow-sm);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === Loading State === */
.login-button.loading {
  pointer-events: none;
  opacity: 0.85;
}

.login-button.loading .button-text {
  opacity: 0;
}

.login-button.loading::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  top: 50%;
  left: 50%;
  margin-left: -11px;
  margin-top: -11px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top: 2.5px solid var(--pure-white);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablets */
@media (max-width: 1024px) {
  .login-left {
    padding: var(--spacing-xl);
  }

  .login-right {
    padding: var(--spacing-xl);
  }

  .illustration-content {
    max-width: 380px;
  }

  .login-container {
    max-width: 400px;
    padding: var(--spacing-xl) var(--spacing-xl);
  }

  .medical-stats {
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
  }

  .stat-number {
    font-size: 1.25rem;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .login-page {
    flex-direction: column;
    min-height: 100vh;
  }

  .login-page::before {
    display: none;
  }

  .login-left {
    flex: none;
    min-height: auto;
    padding: var(--spacing-2xl) var(--spacing-lg) var(--spacing-md);
  }

  .pulse-line-wrapper {
    width: 160px;
    height: 30px;
    margin: var(--spacing-md) auto;
  }

  .login-right {
    flex: 1;
    padding: var(--spacing-xs) var(--spacing-2xl) var(--spacing-2xl);
    align-items: center;
  }

  .login-container {
    max-width: 360px;
    width: 100%;
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg) var(--spacing-md);
    font-size: 0.9rem;
  }

  .zencia-logo-clean {
    max-width: 260px;
  }

  .login-title {
    font-size: 1.35rem;
  }

  .login-subtitle {
    font-size: 0.7rem;
  }

  .illustration-text {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
  }

  .medical-stats {
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
  }

  .stat-number {
    font-size: 1.1rem;
  }

  .stat-label {
    font-size: 0.6rem;
  }

  .stat-divider {
    height: 24px;
  }

  .form-group {
    margin-bottom: var(--spacing-md);
  }

  .powered-by-footer {
    position: relative;
    margin-top: var(--spacing-lg);
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .login-left {
    padding: var(--spacing-xl) var(--spacing-md) var(--spacing-sm);
  }

  .login-right {
    padding: 0 var(--spacing-lg) var(--spacing-lg);
    align-items: center;
  }

  .login-container {
    max-width: 320px;
    width: 100%;
    padding: var(--spacing-md) var(--spacing-sm);
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
  }

  .zencia-logo-clean {
    max-width: 220px;
  }

  .zencia-logo-container {
    margin-bottom: var(--spacing-sm);
  }

  .pulse-line-wrapper {
    width: 120px;
    height: 24px;
  }

  .login-header {
    margin-bottom: var(--spacing-lg);
  }

  .header-ecg-line {
    width: 90px;
    height: 18px;
  }

  .login-title {
    font-size: 1.2rem;
  }

  .illustration-text {
    font-size: 0.82rem;
  }

  .medical-stats {
    flex-wrap: nowrap;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
  }

  .stat-number {
    font-size: 1rem;
  }

  .form-input {
    padding: 10px 10px 10px 2.3rem;
    font-size: 0.84rem;
  }

  .input-icon {
    left: 10px;
    width: 0.95rem;
    height: 0.95rem;
  }

  .password-toggle {
    right: 10px;
  }

  .password-toggle svg {
    width: 1rem;
    height: 1rem;
  }

  .form-label {
    font-size: 0.7rem;
  }

  .form-group {
    margin-bottom: var(--spacing-sm);
  }

  .form-options {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
  }

  .login-button {
    padding: 10px;
    font-size: 0.78rem;
    letter-spacing: 1px;
  }

  .login-footer p {
    font-size: 0.72rem;
  }

  .login-footer {
    margin-top: var(--spacing-md);
  }

  .powered-by-footer p {
    font-size: 0.72rem;
  }

  .error-message {
    padding: 10px 12px;
    font-size: 0.75rem;
  }
}

@media (max-width: 360px) {
  .login-title {
    font-size: 1.25rem;
  }

  .illustration-text {
    font-size: 0.78rem;
  }

  .login-button {
    font-size: 0.78rem;
  }

  .medical-stats {
    display: none;
  }
}

/* Landscape Mobile Optimization */
@media (max-height: 500px) and (orientation: landscape) {
  .login-page {
    flex-direction: row;
  }

  .login-left {
    flex: 0.4;
    min-height: 100vh;
    padding: var(--spacing-md);
  }

  .login-right {
    flex: 0.6;
    min-height: 100vh;
    padding: var(--spacing-md);
    align-items: center;
  }

  .zencia-logo-container {
    margin-bottom: var(--spacing-sm);
  }

  .pulse-line-wrapper {
    display: none;
  }

  .illustration-text {
    display: none;
  }

  .medical-stats {
    display: none;
  }

  .login-container {
    padding: var(--spacing-lg) var(--spacing-md);
  }

  .login-header {
    margin-bottom: var(--spacing-md);
  }

  .header-ecg-line {
    display: none;
  }

  .form-group {
    margin-bottom: var(--spacing-sm);
  }

  .form-options {
    margin-bottom: var(--spacing-sm);
  }

  .powered-by-footer {
    position: fixed;
    bottom: var(--spacing-xs);
  }

  .powered-by-footer p {
    font-size: 0.68rem;
  }
}