/* =====================================================
   EasyPage — Shared Styles
   White background, light-blue (#3B82F6) accents, RTL
   ===================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #F8FAFC;
  min-height: 100vh;
  direction: rtl;
  color: #111827;
  -webkit-text-size-adjust: 100%;
}

/* ── Layout ── */
.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.container.wide {
  max-width: 680px;
  align-items: flex-start;
  padding-top: 32px;
}

/* ── Card ── */
.card {
  background: #FFFFFF;
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: 0 4px 32px rgba(59, 130, 246, 0.08), 0 1px 4px rgba(0,0,0,0.06);
  width: 100%;
}

/* ── Logo & headings ── */
.logo {
  font-size: 2rem;
  font-weight: 900;
  color: #3B82F6;
  text-align: center;
  margin-bottom: 6px;
  letter-spacing: -1px;
}

.site-logo {
  display: block;
  max-width: 150px;
  height: auto;
  margin: 0 auto 4px;
}

.header .site-logo {
  display: inline-block;
  max-width: 120px;
  margin: 0;
}

.subtitle {
  color: #6B7280;
  text-align: center;
  margin-bottom: 32px;
  font-size: 0.95rem;
}

.page-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 0.88rem;
  color: #6B7280;
  margin-bottom: 28px;
}

/* ── Header bar (logo + actions) ── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 8px;
  flex-wrap: wrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.header .logo {
  margin-bottom: 0;
  text-align: right;
  font-size: 1.5rem;
}

/* ── Form elements ── */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  color: #374151;
  margin-bottom: 7px;
  font-size: 0.9rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid #E5E7EB;
  border-radius: 10px;
  font-size: 1rem; /* 16px — prevents iOS auto-zoom */
  color: #111827;
  background: #FFFFFF;
  font-family: inherit;
  transition: border-color 0.18s, box-shadow 0.18s;
  direction: rtl;
  -webkit-appearance: none;
  appearance: none;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3B82F6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

/* Price row */
.price-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.price-wrapper input {
  flex: 1;
}

.price-unit {
  font-weight: 800;
  color: #3B82F6;
  font-size: 1.05rem;
  white-space: nowrap;
  min-width: 28px;
}

/* ── File upload ── */
.file-upload-area {
  border: 2px dashed #D1D5DB;
  border-radius: 12px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s;
  background: #F9FAFB;
  user-select: none;
  touch-action: manipulation;
}

.file-upload-area:hover,
.file-upload-area.dragover {
  border-color: #3B82F6;
  background: #EFF6FF;
}

.file-upload-area input[type="file"] {
  display: none;
}

.upload-icon {
  font-size: 2.4rem;
  margin-bottom: 8px;
  display: block;
}

.file-upload-area p {
  color: #6B7280;
  font-size: 0.88rem;
  margin-top: 4px;
}

.file-upload-area p strong {
  color: #3B82F6;
}

/* Image preview — multi-image thumbnails */
#image-preview {
  margin-top: 14px;
  display: none;
  flex-wrap: wrap;
  gap: 10px;
}

#image-preview img {
  width: 88px;
  height: 88px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  border: 2px solid #E5E7EB;
}

/* ── Buttons ── */
.btn {
  display: block;
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  margin-top: 10px;
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  min-height: 48px;
  touch-action: manipulation;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-primary {
  background: #3B82F6;
  color: #FFFFFF;
}

.btn-primary:hover:not(:disabled) {
  background: #2563EB;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.35);
}

.btn-secondary {
  background: #EFF6FF;
  color: #3B82F6;
}

.btn-secondary:hover:not(:disabled) {
  background: #DBEAFE;
}

.btn-outline {
  background: transparent;
  color: #3B82F6;
  border: 2px solid #3B82F6;
}

.btn-outline:hover:not(:disabled) {
  background: #EFF6FF;
}

.btn-sm {
  width: auto;
  padding: 9px 16px;
  font-size: 0.85rem;
  margin-top: 0;
  min-height: 40px;
}

/* ── Alerts ── */
.error-msg {
  background: #FEF2F2;
  color: #DC2626;
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.88rem;
  border: 1px solid #FECACA;
  line-height: 1.5;
}

.success-msg {
  background: #F0FDF4;
  color: #16A34A;
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.88rem;
  border: 1px solid #BBF7D0;
}

.hidden {
  display: none !important;
}

/* ── Spinner ── */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
  flex-shrink: 0;
}

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

/* ── Progress bar ── */
.progress-container {
  margin: 18px 0;
}

.progress-bar {
  width: 100%;
  height: 7px;
  background: #E5E7EB;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3B82F6, #60A5FA);
  border-radius: 4px;
  width: 0%;
  transition: width 0.45s ease;
}

.progress-label {
  font-size: 0.84rem;
  color: #6B7280;
  text-align: center;
  margin-top: 8px;
}

/* ── Result page ── */
.success-icon {
  font-size: 3rem;
  text-align: center;
  margin-bottom: 10px;
}

.success-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #111827;
  text-align: center;
  margin-bottom: 6px;
}

.success-subtitle {
  color: #6B7280;
  text-align: center;
  margin-bottom: 24px;
  font-size: 0.88rem;
}

.result-image-container {
  text-align: center;
  margin: 20px 0 28px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(0,0,0,0.12);
}

.result-image-container img {
  max-width: 100%;
  display: block;
}

/* ══════════════════════════════
   RESPONSIVE — Tablet (≤768px)
   ══════════════════════════════ */
@media (max-width: 768px) {
  .container.wide {
    padding-top: 24px;
  }
  .card {
    padding: 32px 28px;
  }
}

/* ══════════════════════════════
   RESPONSIVE — Phone (≤480px)
   ══════════════════════════════ */
@media (max-width: 480px) {
  .container,
  .container.wide {
    padding: 12px 12px 24px;
    align-items: flex-start;
    padding-top: 16px;
  }

  .card {
    padding: 24px 18px;
    border-radius: 16px;
  }

  .site-logo {
    max-width: 120px;
  }

  .header .site-logo {
    max-width: 100px;
  }

  .page-title {
    font-size: 1.1rem;
  }

  .btn {
    padding: 14px 20px;
    font-size: 0.97rem;
  }

  .btn-sm {
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  /* Stack header when items overflow */
  .header {
    gap: 10px;
  }

  .file-upload-area {
    padding: 22px 14px;
  }

  #image-preview img {
    width: 76px;
    height: 76px;
  }
}

/* ══════════════════════════════
   RESPONSIVE — Small phone (≤360px)
   ══════════════════════════════ */
@media (max-width: 360px) {
  .card {
    padding: 20px 14px;
  }
  .btn-sm {
    padding: 7px 10px;
    font-size: 0.77rem;
  }
}
