/* ==========================================================================
   Landing / Public Pages Stylesheet
   ========================================================================== */

.landing-body {
  background: linear-gradient(135deg, #f8fafc 0%, #e8f0e8 100%);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.landing-bg-decoration {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(45, 122, 74, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(201, 164, 73, 0.06) 0%, transparent 40%);
}

/* ==========================================================================
   Site Header (white bar with logo + admin button)
   ========================================================================== */
.site-header {
  background: #ffffff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  position: relative;
  z-index: 10;
  height: 110px;
  overflow: visible;
}

.site-header-inner {
  width: 100%;
  height: 60px;
  padding: 0 40px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  box-sizing: border-box;
  direction: rtl;
}

/* الشعار: أكبر من الهيدر بكثير، يخرج بدون ما يكبّر الهيدر */
.site-header-logo {
  height: 130px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  grid-column: 1;
  display: block;
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
}

/* اسم المؤسسة: العمود الأوسط */
.site-header-title {
transform: translateX(-65px);
  font-family: 'Tajawal', sans-serif;
  font-size: 30px;
  font-weight: 900;
  color: #1f5a35;
  margin: 0;
  letter-spacing: 0;
  white-space: nowrap;
  text-align: center;
  grid-column: 2;
}

/* زر الأدمن: آخر عمود (يسار في RTL) */
.site-header-admin-btn {
  background: transparent;
  color: #1f5a35;
  border: 2px solid #1f5a35;
  padding: 10px 26px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  font-family: 'Tajawal', sans-serif;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
  grid-column: 3;
  justify-self: end;
}

.site-header-admin-btn:hover {
  background: #1f5a35;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(31, 90, 53, 0.25);
}

/* في الموبايل نخفي اسم المؤسسة عشان ما تتزاحم العناصر */
@media (max-width: 700px) {
  .site-header-inner {
    padding: 14px 18px;
    gap: 12px;
  }
  .site-header-logo { height: 60px; }
  .site-header-title { font-size: 16px; }
  .site-header-admin-btn { padding: 8px 16px; font-size: 13px; }
}

.landing-main {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 24px 40px;
}

/* Layout for single card centered on the page */
.landing-main-single {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.landing-card-centered {
  max-width: 460px;
  width: 100%;
  padding: 56px 40px !important;
}

/* ==========================================================================
   Header
   ========================================================================== */
.landing-header {
  text-align: center;
  margin-bottom: 60px;
}

.landing-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
  min-height: 80px;
}

.landing-logos img {
  height: 80px;
  width: auto;
  object-fit: contain;
}

.landing-title {
  font-size: 32px;
  font-weight: 900;
  color: var(--accent-2);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.landing-subtitle {
  font-size: 17px;
  color: var(--text-dim);
  font-weight: 400;
}

/* ==========================================================================
   Options Cards
   ========================================================================== */
.landing-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 60px;
}

@media (max-width: 768px) {
  .landing-options { grid-template-columns: 1fr; }
}

.landing-card {
  background: #fff;
  border-radius: 20px;
  padding: 40px 32px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border: 2px solid transparent;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.landing-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s ease;
}

.landing-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(45, 122, 74, 0.15);
  border-color: var(--accent);
}

.landing-card:hover::before {
  transform: scaleX(1);
  transform-origin: left;
}

.landing-card-secondary::before {
  background: var(--gold);
}

.landing-card-secondary:hover {
  border-color: var(--gold);
  box-shadow: 0 16px 40px rgba(201, 164, 73, 0.18);
}

.landing-card-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, rgba(45, 122, 74, 0.1), rgba(45, 122, 74, 0.05));
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  color: var(--accent);
}

.landing-card-secondary .landing-card-icon {
  background: linear-gradient(135deg, rgba(201, 164, 73, 0.15), rgba(201, 164, 73, 0.05));
  color: #b8932f;
}

.landing-card-icon svg {
  width: 40px;
  height: 40px;
}

.landing-card h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
}

.landing-card p {
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 24px;
  max-width: 300px;
}

.landing-card-cta {
  background: var(--accent);
  color: #fff;
  padding: 12px 28px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 14px;
  transition: all 0.2s;
}

.landing-card-secondary .landing-card-cta {
  background: var(--gold);
  color: #1a1a1a;
}

.landing-card:hover .landing-card-cta {
  transform: scale(1.05);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.landing-footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  padding: 40px 0 20px;
}

/* ==========================================================================
   Back Link
   ========================================================================== */
.back-link {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 24px;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--accent-2);
}

/* ==========================================================================
   Tabs
   ========================================================================== */
.tabs {
  display: flex;
  background: #fff;
  border-radius: 14px;
  padding: 6px;
  margin-bottom: 32px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.tab-btn {
  flex: 1;
  padding: 14px 20px;
  background: transparent;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.25s;
}

.tab-btn:hover:not(.active) {
  color: var(--text);
}

.tab-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(45, 122, 74, 0.25);
}

/* ==========================================================================
   Forms
   ========================================================================== */
.form-section {
  background: #fff;
  border-radius: 20px;
  padding: 40px;
  max-width: 800px;
  margin: 0 auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.attendance-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  .form-section { padding: 24px; }
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-field label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.required {
  color: var(--error);
  font-weight: 700;
}

.form-field input,
.form-field select {
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  background: var(--surface-2);
  color: var(--text);
  transition: all 0.2s;
}

.form-field input:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(45, 122, 74, 0.1);
}

.form-field input::placeholder {
  color: #aab2bd;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn-large {
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 700;
  margin-top: 12px;
  width: 100%;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: var(--accent-2);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(45, 122, 74, 0.3);
}

.btn-primary:disabled {
  background: #aab2bd;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ==========================================================================
   Result Section
   ========================================================================== */
.result-section {
  margin-top: 32px;
  background: #fff;
  border-radius: 20px;
  padding: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  animation: slideUp 0.4s ease;
}

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

.result-success {
  text-align: center;
}

.result-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #059669;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.result-icon-pending {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #b45309;
}

.result-icon svg {
  width: 40px;
  height: 40px;
}

.result-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.result-message {
  color: var(--text-dim);
  font-size: 15px;
  margin-bottom: 24px;
}

.attendee-info {
  background: var(--surface-2);
  border-radius: 14px;
  padding: 20px;
  margin: 24px auto;
  max-width: 500px;
  text-align: right;
}

.attendee-info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.attendee-info-row:last-child { border-bottom: none; }

.attendee-info-label { color: var(--text-dim); font-weight: 500; }
.attendee-info-value { color: var(--text); font-weight: 600; }

/* ==========================================================================
   Certificate Display
   ========================================================================== */
.certificate-display {
  margin-top: 24px;
  background: #fafbfc;
  border-radius: 14px;
  padding: 16px;
  border: 1px solid var(--border);
}

.certificate-display img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.certificate-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-download {
  background: var(--accent);
  color: #fff;
  padding: 12px 24px;
  border-radius: 10px;
  border: none;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s;
}

.btn-download:hover {
  background: var(--accent-2);
  transform: translateY(-1px);
}

/* ==========================================================================
   Login Card
   ========================================================================== */
.login-main {
  max-width: 480px;
  padding-top: 180px;
}

.login-card {
  background: #fff;
  border-radius: 20px;
  padding: 48px 40px;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.login-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, rgba(201, 164, 73, 0.15), rgba(201, 164, 73, 0.05));
  color: #b8932f;
  border-radius: 18px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-icon svg {
  width: 36px;
  height: 36px;
}

.login-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
}

.login-subtitle {
  color: var(--text-dim);
  margin-bottom: 32px;
  font-size: 14px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: right;
}

.login-error {
  background: #fee2e2;
  color: var(--error);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  text-align: center;
  font-weight: 500;
}

/* ==========================================================================
   Toast
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #fff;
  padding: 14px 24px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  font-weight: 600;
  font-size: 14px;
  border-right: 4px solid var(--accent);
  animation: toastIn 0.3s ease;
  min-width: 280px;
  text-align: center;
}

.toast.success { border-right-color: var(--success); color: var(--success); }
.toast.error { border-right-color: var(--error); color: var(--error); }
.toast.info { border-right-color: var(--accent); color: var(--accent); }

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ==========================================================================
   Loading State
   ========================================================================== */
.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-bottom-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-left: 8px;
}

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