﻿/*
 * Contact Glass — Editorial Magazine
 * Purple V2 Theme | RTL / Persian | Dark Purple + Gold
 */

/* ============================================================
   CSS Custom Properties
   ============================================================ */
:root {
  --ct-gold:          var(--theme-color-accent);
  --ct-gold-bright:   var(--theme-color-gold-light);
  --ct-gold-soft:     rgba(var(--theme-color-accent-rgb), 0.15);
  --ct-gold-border:   rgba(var(--theme-color-accent-rgb), 0.38);
  --ct-purple-accent: var(--theme-color-accent-2);
  --ct-purple-glow:   rgba(var(--theme-color-accent-2-rgb), 0.22);
  --ct-text:          var(--theme-color-text);
  --ct-text-muted:    var(--theme-color-muted);
  --ct-text-faint:    rgba(var(--theme-color-muted-rgb, 200, 186, 215), 0.62);
  --ct-border:        rgba(var(--theme-color-border-rgb), 0.13);
  --ct-border-strong: rgba(var(--theme-color-border-rgb), 0.28);
  --ct-glass-bg:      rgba(var(--theme-color-surface-rgb), 0.68);
  --ct-input-bg:      rgba(var(--theme-color-surface-2-rgb), 0.55);
  --ct-danger:        var(--theme-color-danger);
  --ct-glass-blur:    18px;
  --ct-radius:        16px;
  --ct-radius-lg:     22px;
  --ct-radius-sm:     10px;
  --ct-ease:          0.25s ease;
  --ct-shadow:        0 8px 32px rgba(0, 0, 0, 0.34);
  --ct-shadow-hover:  0 22px 58px rgba(0, 0, 0, 0.55);

  --ct-fs-xs: 0.694rem;
  --ct-fs-sm: 0.833rem;
  --ct-fs-base: 1rem;
  --ct-fs-md: 1.2rem;
  --ct-fs-lg: 1.44rem;
  --ct-fs-xl: 1.728rem;
}

/* ============================================================
   Section wrapper
   ============================================================ */
.ct-section {
  direction: rtl;
  font-family: "Vazir", Tahoma, Arial, sans-serif;
  color: var(--ct-text);
  max-width: 1100px;
  margin: 0 auto;
  padding: 8px 0 48px;
}

/* ============================================================
   Page header
   ============================================================ */
.ct-header {
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--ct-border);
}

.ct-header__title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 8px;
  font-size: var(--ct-fs-xl);
  font-weight: 800;
  font-family: "Lalezar", "Vazir", Tahoma, Arial, sans-serif;
  color: var(--ct-text);
}

.ct-header__title::before {
  content: "";
  display: block;
  width: 4px;
  height: 30px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--ct-gold) 0%, var(--ct-purple-accent) 100%);
  flex-shrink: 0;
}

.ct-header__subtitle {
  margin: 0;
  color: var(--ct-text-muted);
  font-size: var(--ct-fs-sm);
  line-height: 1.75;
}

/* ============================================================
   Layout grid — form + aside
   ============================================================ */
.ct-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.ct-grid--single { grid-template-columns: minmax(0, 1fr); max-width: 720px; }

/* ============================================================
   Glass cards
   ============================================================ */
.ct-card {
  position: relative;
  background: var(--ct-glass-bg);
  -webkit-backdrop-filter: blur(var(--ct-glass-blur));
  backdrop-filter: blur(var(--ct-glass-blur));
  border: 1px solid var(--ct-border);
  border-radius: var(--ct-radius-lg);
  box-shadow: var(--ct-shadow);
  padding: 28px;
  overflow: hidden;
}

.ct-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--ct-gold-border), transparent);
  pointer-events: none;
}

/* ============================================================
   Aside info boxes
   ============================================================ */
.ct-aside {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ct-info {
  background: var(--ct-glass-bg);
  -webkit-backdrop-filter: blur(var(--ct-glass-blur));
  backdrop-filter: blur(var(--ct-glass-blur));
  border: 1px solid var(--ct-border);
  border-radius: var(--ct-radius);
  padding: 22px;
  color: var(--ct-text-muted);
  font-size: var(--ct-fs-sm);
  line-height: 1.8;
  box-shadow: var(--ct-shadow);
}

.ct-info__title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 12px;
  font-size: var(--ct-fs-md);
  font-weight: 700;
  font-family: "Lalezar", "Vazir", Tahoma, Arial, sans-serif;
  color: var(--ct-gold);
}

.ct-info__title svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

.ct-info a { color: var(--ct-gold); text-decoration: none; transition: color var(--ct-ease); }
.ct-info a:hover { color: var(--ct-gold-bright); }

/* Map embed */
.ct-map {
  border-radius: var(--ct-radius);
  overflow: hidden;
  border: 1px solid var(--ct-border);
  box-shadow: var(--ct-shadow);
  line-height: 0;
}

.ct-map iframe { width: 100%; min-height: 260px; border: 0; }

/* ============================================================
   Form
   ============================================================ */
.ct-form { display: flex; flex-direction: column; gap: 18px; }

.ct-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.ct-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }

.ct-field__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ct-gold);
  font-size: var(--ct-fs-sm);
  font-weight: 600;
  margin: 0;
}

.ct-field__label svg {
  width: 15px;
  height: 15px;
  opacity: 0.85;
  flex-shrink: 0;
}

.ct-field__required {
  color: var(--ct-danger);
  font-size: var(--ct-fs-sm);
  line-height: 1;
}

.ct-input,
.ct-textarea,
.ct-select {
  width: 100%;
  background: var(--ct-input-bg);
  color: var(--ct-text);
  border: 1px solid var(--ct-border-strong);
  border-radius: var(--ct-radius-sm);
  padding: 11px 14px;
  font-family: inherit;
  font-size: var(--ct-fs-base);
  line-height: 1.5;
  transition: border-color var(--ct-ease), box-shadow var(--ct-ease), background var(--ct-ease);
  appearance: none;
}

.ct-input::placeholder,
.ct-textarea::placeholder { color: var(--ct-text-faint); }

.ct-input:hover,
.ct-textarea:hover,
.ct-select:hover { border-color: var(--ct-gold-border); }

.ct-input:focus,
.ct-textarea:focus,
.ct-select:focus {
  outline: none;
  border-color: var(--ct-gold);
  box-shadow: 0 0 0 3px var(--ct-gold-soft);
  background: rgba(var(--theme-color-surface-2-rgb), 0.8);
}

.ct-textarea { min-height: 150px; resize: vertical; }

.ct-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23c8bad7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  padding-left: 38px;
  cursor: pointer;
}

.ct-select option {
  background: var(--theme-color-surface);
  color: var(--ct-text);
}

/* Error state */
.ct-field--error .ct-input,
.ct-field--error .ct-textarea,
.ct-field--error .ct-select {
  border-color: var(--ct-danger);
  box-shadow: 0 0 0 3px rgba(var(--theme-color-danger-rgb), 0.18);
}

.ct-field__error {
  display: none;
  align-items: center;
  gap: 5px;
  color: var(--ct-danger);
  font-size: var(--ct-fs-xs);
  line-height: 1.4;
}

.ct-field--error .ct-field__error { display: inline-flex; }

.ct-field__error svg { width: 13px; height: 13px; flex-shrink: 0; }

/* ============================================================
   Captcha
   ============================================================ */
.ct-captcha {
  display: flex;
  justify-content: center;
  margin: 4px 0;
}

/* ============================================================
   Submit button
   ============================================================ */
.ct-actions {
  display: flex;
  justify-content: center;
  margin-top: 6px;
}

.ct-submit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 220px;
  min-height: 48px;
  padding: 12px 44px;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--ct-gold), var(--theme-color-gold-base));
  color: var(--theme-color-on-accent);
  font-family: inherit;
  font-size: var(--ct-fs-base);
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--ct-ease), box-shadow var(--ct-ease), filter var(--ct-ease);
  box-shadow: 0 10px 26px rgba(var(--theme-color-accent-rgb), 0.32);
}

.ct-submit svg { width: 18px; height: 18px; }

.ct-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(var(--theme-color-accent-rgb), 0.45);
  filter: brightness(1.05);
}

.ct-submit:active { transform: translateY(0); }

.ct-submit:focus-visible {
  outline: 2px solid var(--ct-gold-bright);
  outline-offset: 3px;
}

.ct-submit[disabled] {
  cursor: default;
  opacity: 0.6;
  transform: none;
  box-shadow: 0 6px 16px rgba(var(--theme-color-accent-rgb), 0.2);
}

/* Loading spinner inside button */
.ct-submit__spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(var(--theme-color-border-rgb), 0.3);
  border-top-color: var(--theme-color-on-accent);
  border-radius: 50%;
  animation: ct-spin 0.7s linear infinite;
}

.ct-submit--loading .ct-submit__spinner { display: block; }
.ct-submit--loading .ct-submit__icon { display: none; }

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

/* ============================================================
   Entrance animation
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .ct-card,
  .ct-aside > * {
    animation: ct-rise 0.45s ease-out both;
  }
  .ct-aside > :nth-child(1) { animation-delay: 0.06s; }
  .ct-aside > :nth-child(2) { animation-delay: 0.12s; }
  .ct-aside > :nth-child(3) { animation-delay: 0.18s; }
}

@keyframes ct-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .ct-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
  .ct-card { padding: 20px 16px; }
  .ct-form__row { grid-template-columns: 1fr; }
  .ct-submit { width: 100%; }
  .ct-header__title { font-size: var(--ct-fs-lg); }
}
