@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&display=swap');

:root {
  --bg-dark: #0f172a;
  --card-bg: rgba(30, 41, 59, 0.7);
  --card-border: rgba(255, 255, 255, 0.1);
  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #06b6d4, #3b82f6);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --input-bg: rgba(15, 23, 42, 0.6);
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-glow: 0 8px 32px 0 rgba(6, 182, 212, 0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Cairo', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: var(--bg-dark);
  background-image: 
    radial-gradient(at 0% 0%, rgba(6, 182, 212, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.15) 0px, transparent 50%);
  color: var(--text-main);
  min-height: 100vh;
  direction: rtl;
  padding: 16px;
  display: flex;
  justify-content: center;
}

.container {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 40px;
}

header {
  text-align: center;
  padding: 12px 0;
}

.logo-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 6px 16px;
  border-radius: 30px;
  font-size: 0.85rem;
  color: var(--accent-cyan);
  font-weight: 600;
  margin-bottom: 8px;
  backdrop-filter: blur(10px);
}

h1 {
  font-size: 1.6rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}

p.subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Glass Card */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 10px;
}

/* Segmented Buttons */
.segmented-control {
  display: flex;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  padding: 4px;
  border-radius: var(--radius-md);
  gap: 4px;
}

.segment-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.segment-btn.active {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

/* Form Groups */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

input[type="text"], input[type="number"] {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus, input[type="number"]:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}

/* ISO Chips Grid */
.chips-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chip-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.chip-item:hover {
  border-color: var(--accent-cyan);
}

.chip-item.selected {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--accent-cyan);
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.2s ease;
}

.chip-item.selected .checkbox-custom {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  color: #fff;
}

/* Custom ISO Tag Row */
.custom-iso-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  padding: 0 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Currency Grid */
.currency-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.curr-btn {
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 10px 4px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.curr-btn .flag { font-size: 1.3rem; }
.curr-btn .code { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); }

.curr-btn.selected {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--accent-cyan);
}
.curr-btn.selected .code { color: var(--accent-cyan); }

.standard-price-inputs {
  display: grid;
  gap: 10px;
}

.standard-price-row {
  display: grid;
  gap: 6px;
}

.standard-price-row label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.company-quote-row { padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.company-quote-row:last-child { border-bottom: 0; }

/* Live Tafqeet Box */
.tafqeet-box {
  background: rgba(6, 182, 212, 0.08);
  border: 1px dashed var(--accent-cyan);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 0.9rem;
  color: #67e8f9;
  font-weight: 600;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

/* Summary Preview Card */
.preview-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(6, 182, 212, 0.3);
  box-shadow: var(--shadow-glow);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 6px;
}

.summary-row .val {
  color: var(--text-main);
  font-weight: 600;
}

.summary-row.grand {
  font-size: 1.1rem;
  font-weight: 800;
  color: #38bdf8;
  border-bottom: none;
  padding-top: 6px;
}

/* Submit Action Button */
.btn-primary {
  width: 100%;
  background: var(--accent-gradient);
  border: none;
  color: #fff;
  padding: 14px;
  border-radius: var(--radius-lg);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(6, 182, 212, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(6, 182, 212, 0.5);
}

.btn-primary:active {
  transform: translateY(0);
}
