/* OnPharm Modern Login V2 */
:root {
  --primary: #1B3A5F;
  --secondary: #4AAED9;
  --accent: #266a99;
  --bg-color: #f4f7fb;
  --card-bg: rgba(255, 255, 255, 0.55);
  --text-main: rgba(11, 23, 41, 0.92);
  --text-muted: rgba(11, 23, 41, 0.62);
  --border-color: rgba(10, 30, 60, 0.14);
  --input-focus-ring: rgba(74, 174, 217, 0.22);
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background-color: var(--bg-color) !important;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color) !important;
  background-image:
    radial-gradient(900px 600px at 15% 10%, rgba(74, 174, 217, 0.20) 0%, transparent 60%),
    radial-gradient(800px 600px at 90% 20%, rgba(27, 58, 95, 0.12) 0%, transparent 62%),
    radial-gradient(900px 700px at 70% 90%, rgba(38, 106, 153, 0.10) 0%, transparent 60%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.65) 0%, rgba(255, 255, 255, 0.35) 45%, rgba(255, 255, 255, 0.55) 100%) !important;
  color: var(--text-main) !important;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
}

/* Wrapper */
.auth-wrapper {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

/* Main Card */
.auth-card {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 18px;
  width: 100%;
  max-width: 1080px;
  background: transparent;
  border-radius: 28px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
  overflow: visible;
  min-height: 620px;
}

/* Left Side: Visual */
.auth-visual {
  flex: 1;
  background: linear-gradient(155deg, rgba(74, 174, 217, 0.22) 0%, rgba(255, 255, 255, 0.70) 45%, rgba(27, 58, 95, 0.06) 100%),
    var(--card-bg);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem;
  overflow: hidden;
  color: var(--text-main);
  border-radius: 28px;
  border: 1px solid var(--border-color);
  backdrop-filter: blur(14px);
}

.auth-visual-content {
  position: relative;
  z-index: 10;
}

.brand-logo img {
  height: 40px;
  width: auto;
  filter: none;
  margin-bottom: 2rem;
}

.brand-text h2 {
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
  color: rgba(11, 23, 41, 0.92);
}

.brand-text p {
  font-size: 1rem;
  opacity: 0.82;
  max-width: 300px;
  font-weight: 300;
  color: rgba(11, 23, 41, 0.62);
}

/* Abstract Shapes */
.visual-decor {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.circle-1 {
  position: absolute;
  top: -10%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(74, 174, 217, 0.26) 0%, transparent 70%);
  border-radius: 50%;
}

.circle-2 {
  position: absolute;
  bottom: 10%;
  left: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(27, 58, 95, 0.10) 0%, transparent 60%);
  border-radius: 50%;
}

/* Person Image */
.person-image {
  position: absolute;
  bottom: 0;
  right: 0;
  z-index: 5;
  width: 100%;
  height: 62%;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  pointer-events: none;
}

.person-image img {
  max-height: 100%;
  width: auto;
  object-fit: contain;
  margin-right: -18px;
  filter: drop-shadow(-10px 10px 22px rgba(15, 23, 42, 0.18));
}

/* Right Side: Form */
.auth-form-side {
  flex: 0.9;
  padding: 3.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--border-color);
  border-radius: 28px;
  backdrop-filter: blur(14px);
}

.form-header {
  margin-bottom: 2rem;
}

.form-header h3 {
  font-size: 1.75rem;
  font-weight: 700;
  color: rgba(11, 23, 41, 0.94);
  margin-bottom: 0.5rem;
}

.text-muted {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Modern Form Styles */
.modern-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(11, 23, 41, 0.78);
}

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

.input-icon {
  position: absolute;
  left: 1rem;
  color: rgba(11, 23, 41, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: color 0.2s ease;
}

.form-control {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 2.75rem;
  border: 1px solid rgba(10, 30, 60, 0.14);
  border-radius: 12px;
  font-size: 1rem;
  color: rgba(11, 23, 41, 0.92);
  transition: all 0.2s ease;
  background-color: rgba(255, 255, 255, 0.72);
}

.form-control:focus {
  outline: none;
  border-color: var(--secondary);
  background-color: rgba(255, 255, 255, 0.88);
  box-shadow: 0 0 0 4px var(--input-focus-ring);
}

.form-control:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
  color: var(--secondary);
}

.form-control::placeholder {
  color: rgba(11, 23, 41, 0.42);
}

/* Checkbox */
.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}

.checkbox-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: rgba(11, 23, 41, 0.62);
  user-select: none;
}

.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  height: 18px;
  width: 18px;
  background-color: rgba(16, 24, 40, 0.04);
  border: 1px solid rgba(10, 30, 60, 0.14);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.checkmark::after {
  content: "";
  display: none;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

.checkbox-container input:checked ~ .checkmark {
  background-color: var(--secondary);
  border-color: var(--secondary);
}

.checkbox-container input:checked ~ .checkmark::after {
  display: block;
}

.forgot-link {
  font-size: 0.9rem;
  color: var(--secondary);
  text-decoration: none;
  font-weight: 500;
}

.forgot-link:hover {
  text-decoration: underline;
}

/* Button */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 1rem;
  background-image: linear-gradient(135deg, rgba(74, 174, 217, 0.95) 0%, rgba(38, 106, 153, 0.95) 55%, rgba(27, 58, 95, 0.95) 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 1rem;
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.18);
}

.btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 22px 36px rgba(15, 23, 42, 0.22);
}

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

.btn-icon {
  opacity: 0.8;
}

/* Footer */
.auth-footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(11, 23, 41, 0.5);
}

/* Messages */
.system-messages {
    margin-bottom: 1.5rem;
}
.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    border: 1px solid transparent;
}
.alert-error, .alert-danger {
    background-color: rgba(220, 38, 38, 0.10);
    border-color: rgba(220, 38, 38, 0.20);
    color: rgba(127, 29, 29, 0.95);
}
.alert-warning {
    background-color: rgba(245, 158, 11, 0.10);
    border-color: rgba(245, 158, 11, 0.20);
    color: rgba(120, 53, 15, 0.95);
}
.alert-success {
    background-color: rgba(34, 197, 94, 0.10);
    border-color: rgba(34, 197, 94, 0.20);
    color: rgba(20, 83, 45, 0.95);
}
.alert-info {
    background-color: rgba(59, 130, 246, 0.10);
    border-color: rgba(59, 130, 246, 0.20);
    color: rgba(30, 64, 175, 0.95);
}

/* Responsive */
@media (max-width: 900px) {
  .auth-card {
    grid-template-columns: 1fr;
    gap: 14px;
    max-width: 500px;
    min-height: auto;
  }

  .auth-visual {
    padding: 2.5rem;
    min-height: 200px;
    flex: none;
  }

  .person-image {
    display: none; /* Hide image on tablet/mobile to save space */
  }

  .brand-logo img {
    margin-bottom: 1rem;
  }

  .brand-text h2 {
    font-size: 2rem;
  }
  
  .auth-form-side {
    padding: 2.5rem;
  }
}

@media (max-width: 480px) {
  .auth-wrapper {
    padding: 1rem;
    align-items: flex-start;
  }

  .auth-card {
    border-radius: 18px;
    margin-top: 1rem;
  }

  .auth-visual {
    padding: 2rem;
  }

  .auth-form-side {
    padding: 2rem 1.5rem;
  }

  .brand-text h2 {
    font-size: 1.75rem;
  }
}
