/* Base Styles & Typography */
:root {
  --primary-color: #1e40af;
  --primary-hover: #1e3a8a;
  --secondary-color: #0284c7;
  --bg-gradient: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #cbd5e1;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 20px 30px -10px rgba(30, 64, 175, 0.12);
  --radius-md: 16px;
  --radius-lg: 24px;
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 16px;
  direction: ltr;
}

.main-container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
}

/* Header Card */
.header-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  margin-bottom: 24px;
  border-top: 6px solid var(--primary-color);
  transition: transform 0.3s ease;
}

.logo-wrapper {
  margin-bottom: 16px;
  text-align: center;
}

.school-logo {
  max-width: 270px;
  width: 100%;
  height: auto;
  object-fit: contain;
  display: inline-block;
}

.header-card .subtitle {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  font-weight: 500;
  max-width: 520px;
  margin: 0 auto;
}

/* Common Cards */
.form-card, .status-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 24px;
}

.hidden {
  display: none !important;
}

/* Animations */
.animated-fade {
  animation: fadeIn 0.5s ease-out forwards;
}

.animated-pop {
  animation: popUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.success-card-animation {
  animation: popSuccess 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

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

@keyframes popUp {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes popSuccess {
  from { opacity: 0; transform: scale(0.85) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Form Controls */
.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  color: #1e293b;
  margin-bottom: 10px;
}

.form-group label i {
  color: var(--primary-color);
  font-size: 16px;
}

.required {
  color: var(--danger-color);
}

input[type="text"],
select,
textarea {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text-main);
  background: #f8fafc;
  transition: all 0.25s ease;
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  padding-right: 40px;
}

.select-wrapper {
  position: relative;
  width: 100%;
}

.select-arrow {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-muted);
  font-size: 14px;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.12);
}

textarea {
  resize: vertical;
  min-height: 90px;
}

.divider {
  border: 0;
  height: 1px;
  background: var(--border-color);
  margin: 28px 0;
}

/* Error Messages */
.error-msg {
  display: none;
  color: var(--danger-color);
  font-size: 13px;
  font-weight: 600;
  margin-top: 6px;
}

.form-group.has-error input,
.form-group.has-error textarea {
  border-color: var(--danger-color);
  background: #fef2f2;
}

.form-group.has-error .error-msg {
  display: block;
}

/* Submit Button */
.btn-submit {
  width: 100%;
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 16px 24px;
  border-radius: 14px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  box-shadow: 0 6px 16px rgba(30, 64, 175, 0.25);
}

.btn-submit:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(30, 64, 175, 0.35);
}

.btn-submit:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  transform: none;
}

/* Spinners */
.spinner, .btn-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

.spinner {
  border: 3px solid rgba(30, 64, 175, 0.15);
  border-top-color: var(--primary-color);
  width: 44px;
  height: 44px;
  margin: 0 auto 16px auto;
}

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

/* Status Cards & Icons */
.status-card {
  text-align: center;
}

.status-icon {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  margin-bottom: 20px;
}

.warning-icon {
  background: #fef3c7;
  color: var(--warning-color);
}

.pulse-animation {
  animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
  70% { box-shadow: 0 0 0 16px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.clock-icon {
  background: #fef2f2;
  color: var(--danger-color);
}

.status-card h2 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 12px;
  color: #0f172a;
}

.status-card p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.notice-box, .cairo-clock, .success-footer {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
}

.notice-box {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.cairo-clock {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.success-footer {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

/* Success Checkmark Animation */
.success-checkmark-wrapper {
  margin: 10px auto 25px auto;
  display: flex;
  justify-content: center;
}

.check-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 4px solid var(--success-color);
  position: relative;
  box-sizing: content-box;
}

.check-icon::before {
  top: 3px;
  left: -2px;
  width: 30px;
  transform-origin: 100% 50%;
  border-radius: 100px 0 0 100px;
}

.check-icon::after {
  top: 0;
  left: 30px;
  width: 60px;
  transform-origin: 0 50%;
  border-radius: 0 100px 100px 0;
  animation: rotateCircle 4.25s ease-in;
}

.check-icon .icon-line {
  height: 5px;
  background-color: var(--success-color);
  display: block;
  border-radius: 2px;
  position: absolute;
  z-index: 10;
}

.check-icon .line-tip {
  top: 46px;
  left: 19px;
  width: 25px;
  transform: rotate(45deg);
  animation: iconLineTip 0.75s;
}

.check-icon .line-long {
  top: 38px;
  right: 12px;
  width: 47px;
  transform: rotate(-45deg);
  animation: iconLineLong 0.75s;
}

@keyframes iconLineTip {
  0% { width: 0; left: 1px; top: 19px; }
  54% { width: 0; left: 1px; top: 19px; }
  70% { width: 50px; left: -8px; top: 37px; }
  84% { width: 17px; left: 21px; top: 48px; }
  100% { width: 25px; left: 19px; top: 46px; }
}

@keyframes iconLineLong {
  0% { width: 0; right: 46px; top: 54px; }
  65% { width: 0; right: 46px; top: 54px; }
  84% { width: 55px; right: 0px; top: 35px; }
  100% { width: 47px; right: 12px; top: 38px; }
}

/* Footer */
.footer {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 12px;
}

/* Responsive */
@media (max-width: 480px) {
  .header-card, .form-card, .status-card {
    padding: 24px 20px;
  }
  .school-logo {
    max-width: 220px;
  }
}
