/** @format */

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --success: #10b981;
  --success-hover: #059669;
  --dark-bg: #0f172a;
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --input-bg: #f8fafc;
}

/* 🌈 100% Offline Animated Rainbow Gradient Background */
body {
  font-family: 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  padding: 20px;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;

  /* Rainbow වර්ණ එකතුව */
  background: linear-gradient(
    -45deg,
    #ee7752,
    #e73c7e,
    #23a6d5,
    #23d5ab,
    #4f46e5
  );
  background-size: 400% 400%;
  animation: rainbow_animation 15s ease infinite;
}

/* පසුබිම් වර්ණ සෙමින් චලනය වන ඇනිමේෂන් එක */
@keyframes rainbow_animation {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* ✨ Glassmorphic Center Card */
.auth-container {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  width: 100%;
  max-width: 440px;
  padding: 40px 35px;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.auth-container h2 {
  margin: 0 0 6px 0;
  font-size: 26px;
  color: var(--dark-bg);
  text-align: center;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.auth-container .subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 28px;
  display: block;
}

/* 📝 Form Groups & Icons */
.form-group {
  margin-bottom: 18px;
  position: relative;
}

.form-group i.field-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 15px;
  transition: color 0.2s ease;
  pointer-events: none;
  z-index: 2;
}

.form-control {
  width: 100%;
  padding: 13px 16px 13px 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14.5px;
  color: var(--text-main);
  box-sizing: border-box;
  transition: all 0.2s;
  background: var(--input-bg);
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.form-group:focus-within i.field-icon {
  color: var(--primary);
}

/* 🔌 FontAwesome 5.15.4 Dropdown Arrow Fix */
select.form-control {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 40px;
}

.form-group-select::after {
  content: '\f0d7'; /* FontAwesome 5 Down Arrow Code */
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  pointer-events: none;
  z-index: 2;
  font-size: 14px;
}

/* 🚀 Modern Buttons */
button[type='submit'] {
  width: 100%;
  color: white;
  border: none;
  padding: 14px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.btn-login {
  background: var(--primary);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}
.btn-login:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-register {
  background: var(--success);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}
.btn-register:hover {
  background: var(--success-hover);
  transform: translateY(-1px);
}

button[type='submit']:active {
  transform: translateY(1px);
}

.toggle-link {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
  display: block;
}
.toggle-link:hover {
  color: var(--primary);
}

.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 20px;
  text-align: center;
}
.alert-danger {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fee2e2;
}
