/* ===================================================
   واجهة الدخول - Code School Login CSS
   Gold & Cream Theme (matched to MAINUI.CSS)
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700&family=Amiri:wght@400;700&display=swap');

/* ---- Variables ---- */
:root {
  --primary:       #C9A84C;
  --primary-light: #E8C97A;
  --accent:        #BA7517;
  --accent-dim:    rgba(201, 168, 76, 0.18);
  --surface:       rgba(255, 255, 255, 0.65);
  --surface-hover: rgba(255, 255, 255, 0.85);
  --border:        rgba(201, 168, 76, 0.35);
  --text-main:     #1A1208;
  --text-muted:    rgba(92, 74, 42, 0.65);
  --danger:        #c0392b;
  --radius:        14px;
  --radius-sm:     8px;
  --transition:    0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Tajawal', 'Noto Naskh Arabic', sans-serif;
  font-size: 16px;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  direction: rtl;

  /* === BACKGROUND === */
  background-color: #FBF7EC;
  background-image:
    radial-gradient(ellipse 80% 60% at 15% 20%, rgba(201, 168, 76, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 60% 80% at 85% 75%, rgba(186, 117, 23, 0.16) 0%, transparent 55%),
    radial-gradient(ellipse 50% 50% at 50% 50%, rgba(245, 237, 214, 0.6) 0%, transparent 80%),
    radial-gradient(circle, rgba(201, 168, 76, 0.25) 1px, transparent 1px);
  background-size:
    100% 100%,
    100% 100%,
    100% 100%,
    38px 38px;
}

/* Animated floating shapes */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.30;
  pointer-events: none;
  animation: float 10s ease-in-out infinite alternate;
}

body::before {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, #E8C97A 0%, transparent 70%);
  top: -140px;
  left: -100px;
  animation-duration: 12s;
}

body::after {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #BA7517 0%, transparent 70%);
  bottom: -180px;
  right: -120px;
  animation-duration: 15s;
  animation-delay: -5s;
}

@keyframes float {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(30px, -20px) scale(1.05); }
  100% { transform: translate(-15px, 15px) scale(0.97); }
}

/* ---- Main Container ---- */
main.container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 440px;
  padding: 2.5rem 2.25rem;
  margin: 0 auto;

  background: rgba(245, 237, 214, 0.93);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow:
    0 8px 32px rgba(201, 168, 76, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 -1px 0 rgba(139, 105, 20, 0.08) inset;

  animation: slideUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

/* Logo / Header area */
main.container::before {
  content: '🎓';
  display: block;
  font-size: 3rem;
  text-align: center;
  margin-bottom: 0.4rem;
  filter: drop-shadow(0 0 12px rgba(201, 168, 76, 0.6));
  animation: pulseIcon 3s ease-in-out infinite;
}

@keyframes pulseIcon {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(201, 168, 76, 0.5)); }
  50%       { filter: drop-shadow(0 0 20px rgba(201, 168, 76, 0.9)); }
}

/* ---- Form ---- */
form {
  width: 100%;
}

/* ---- Form Groups ---- */
.mb-3,
.mb-1 {
  margin-bottom: 1.1rem;
}

/* ---- Labels ---- */
label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}

/* ---- Inputs & Datalist ---- */
input,
input.form-control,
select {
  width: 100% !important;
  padding: 0.72rem 1rem;
  font-family: 'Tajawal', sans-serif;
  font-size: 0.95rem;
  color: var(--text-main);
  background: rgba(255, 252, 240, 0.9) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  outline: none;
  transition:
    border-color var(--transition),
    background var(--transition),
    box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

input::placeholder {
  color: var(--text-muted);
  font-size: 0.9rem;
}

input:hover,
input.form-control:hover {
  background: var(--surface-hover) !important;
  border-color: rgba(201, 168, 76, 0.55) !important;
}

input:focus,
input.form-control:focus {
  background: #fffdf8 !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.22) !important;
  color: var(--text-main);
}

/* Datalist input icon hint */
input[list] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23BA7517' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: left 0.85rem center !important;
  padding-left: 2.2rem !important;
}

/* ---- Password field ---- */
input[type="password"] {
  letter-spacing: 0.12em;
}

/* ---- Submit Button ---- */
button[type="submit"],
.btn-primary {
  width: 100%;
  padding: 0.8rem 1.5rem;
  margin-top: 1.4rem;
  font-family: 'Amiri', 'Tajawal', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-main) !important;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%) !important;
  border: none !important;
  border-radius: var(--radius) !important;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    filter var(--transition);
  box-shadow: 0 4px 18px rgba(201, 168, 76, 0.38);
}

button[type="submit"]::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: background var(--transition);
}

button[type="submit"]:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%) !important;
  color: #fff !important;
  box-shadow: 0 6px 26px rgba(201, 168, 76, 0.55);
  filter: brightness(1.04);
}

button[type="submit"]:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 10px rgba(201, 168, 76, 0.3);
}

/* Ripple effect on button */
button[type="submit"]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

/* ---- Registration Link ---- */
a[href] {
  display: block;
  text-align: center;
  margin-top: 1.2rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
  position: relative;
}

a[href]::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: 50%;
  left: 50%;
  height: 1px;
  background: var(--primary);
  transition: left var(--transition), right var(--transition);
}

a[href]:hover {
  color: var(--accent);
}

a[href]:hover::after {
  right: 0;
  left: 0;
}

/* ---- Required field indicator ---- */
input:required:not(:placeholder-shown):invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.18) !important;
}

input:required:not(:placeholder-shown):valid {
  border-color: rgba(201, 168, 76, 0.6) !important;
}

/* ---- Bootstrap Overrides ---- */
.form-control:focus {
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.22) !important;
  border-color: var(--primary) !important;
}

/* ---- Page Title (add a heading above the form) ---- */
.login-title {
  text-align: center;
  font-family: 'Amiri', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.2rem;
  letter-spacing: 0.01em;
}

.login-subtitle {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1.8rem;
}

/* ---- Divider ---- */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.4rem 0;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(201, 168, 76, 0.4);
  border-radius: 4px;
}

/* ---- Responsive ---- */
@media (max-width: 520px) {
  main.container {
    margin: 1rem;
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 360px) {
  main.container {
    padding: 1.5rem 1.1rem;
  }
}
