:root {
  --background: hsl(210, 20%, 98%);
  --foreground: hsl(215, 25%, 15%);
  --card: hsl(0, 0%, 100%);
  --card-foreground: hsl(215, 25%, 15%);
  --primary: hsl(215, 80%, 35%);
  --primary-hover: hsl(215, 80%, 30%);
  --primary-foreground: hsl(0, 0%, 100%);
  --muted: hsl(210, 15%, 92%);
  --muted-foreground: hsl(215, 15%, 45%);
  --border: hsl(214, 20%, 88%);
  --input-bg: hsl(210, 20%, 98%);
  --input-border: hsl(214, 20%, 85%);
  --input-focus: hsl(215, 80%, 35%);
  --destructive: hsl(0, 84%, 60%);
  --admin: hsl(152, 60%, 40%);
  --admin-hover: hsl(152, 60%, 35%);
  --radius: 0.75rem;
  --shadow-card: 0 4px 20px -4px hsla(215, 30%, 20%, 0.1);
  --shadow-card-hover: 0 12px 32px -8px hsla(215, 30%, 20%, 0.15);
  --shadow-header: 0 4px 24px -2px hsla(152, 60%, 40%, 0.25);
}

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

body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, hsl(210, 25%, 97%) 0%, hsl(210, 20%, 92%) 100%);
  min-height: 100vh;
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.page-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.main-wrapper {
  width: 100%;
  max-width: 1000px;
}

.login-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 768px) {
  .login-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Form Card */
.form-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  opacity: 0;
  animation: slideInLeft 0.6s ease-out forwards;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.card-header {
  background: var(--admin);
  color: white;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-header);
}

.card-header h4 {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-header h4 i {
  font-size: 1.1rem;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  background: var(--destructive);
  color: white;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.btn-back:hover {
  opacity: 0.9;
  transform: translateX(-2px);
}

.card-body {
  padding: 2rem;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--input-border);
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-family: inherit;
  background: var(--input-bg);
  color: var(--foreground);
  transition: all 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--input-focus);
  background: white;
  box-shadow: 0 0 0 4px hsla(215, 80%, 35%, 0.1);
}

.form-control::placeholder {
  color: var(--muted-foreground);
}

/* Password wrapper */
.password-wrapper {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 0.25rem;
  transition: color 0.2s ease;
}

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

/* Captcha Section */
.captcha-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
  padding: 1rem;
  background: var(--muted);
  border-radius: 0.5rem;
}

.captcha-image {
  background: white;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  border: 1px solid var(--border);
  font-family: 'Courier New', monospace;
  font-size: 1.5rem;
  font-weight: bold;
  letter-spacing: 4px;
  color: var(--primary);
  user-select: none;
}

.refresh-captcha {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  background: white;
  border: 1px solid var(--border);
  color: var(--primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.refresh-captcha:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.refresh-captcha.spinning i {
  animation: spin 0.6s linear;
}

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

/* Response Message */
.response-message {
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  display: none;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
}

.response-message.show {
  display: flex;
}

.response-message.success {
  background: hsla(152, 60%, 40%, 0.1);
  color: hsl(152, 60%, 30%);
  border: 1px solid hsla(152, 60%, 40%, 0.3);
}

.response-message.error {
  background: hsla(0, 84%, 60%, 0.1);
  color: hsl(0, 60%, 40%);
  border: 1px solid hsla(0, 84%, 60%, 0.3);
}

/* Submit Button */
.btn-submit {
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: 0.5rem;
  background: var(--admin);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-submit:hover:not(:disabled) {
  background: var(--admin-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px hsla(152, 60%, 40%, 0.3);
}

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

.btn-submit i {
  font-size: 0.875rem;
}

/* Brand Section */
.brand-section {
  text-align: center;
  opacity: 0;
  animation: slideInRight 0.6s ease-out 0.2s forwards;
}

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

.brand-logo {
  width: 140px;
  height: 140px;
  margin: 0 auto 1.5rem;
  background: var(--card);
  border-radius: 50%;
  padding: 1rem;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: float 6s ease-in-out infinite;
}

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

.brand-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.brand-logo .logo-placeholder {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary), var(--admin));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo .logo-placeholder i {
  font-size: 2.5rem;
  color: white;
}

.brand-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 0.5rem;
}

.brand-subtitle {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--admin);
}

.brand-description {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.brand-description p {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  line-height: 1.7;
}

/* Footer */
.footer {
  margin-top: 2rem;
  text-align: center;
  grid-column: 1 / -1;
}

.footer p {
  color: var(--muted-foreground);
  font-size: 0.75rem;
}

/* Responsive adjustments */
@media (max-width: 767px) {
  .brand-section {
    order: -1;
  }

  .brand-logo {
    width: 100px;
    height: 100px;
  }

  .brand-title {
    font-size: 1.25rem;
  }

  .brand-subtitle {
    font-size: 1rem;
  }

  .card-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .card-body {
    padding: 1.5rem;
  }
}