/* ============================================
   FastDrop — Restaurant Registration (iOS Native)
   With Input Icons • FastDrop Brand • Dense
   ============================================ */

/* --- 1. Font Import (Inter Only) --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:slnt,wght@-10..0,100..900&display=swap');

/* --- 2. Design Tokens — FastDrop Brand --- */
:root {
  /* Brand Identity */
  --primary: #FF6B35;
  --primary-light: #FF8C5F;
  --secondary: #1A936F;
  --accent: #114B5F;
  --dark: #1C1C1E;

  /* iOS System Surfaces */
  --system-bg: #F2F2F7;
  --system-white: #FFFFFF;
  --system-grouped: #F9F9F9;
  --system-separator: rgba(60, 60, 67, 0.12);
  --system-fill: rgba(120, 120, 128, 0.08);
  --system-fill-secondary: rgba(120, 120, 128, 0.12);

  /* Typography Colors */
  --label-primary: #1C1C1E;
  --label-secondary: #636366;
  --label-tertiary: #AEAEB2;
  --label-quaternary: #D1D1D6;

  /* Semantic */
  --system-green: #34C759;
  --system-red: #FF3B30;
  --system-blue: #007AFF;

  /* Elevation (Soft Layered) */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-float: 0 20px 50px rgba(0, 0, 0, 0.12);

  /* Radius (Squircle) */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Spacing Grid (4px Base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  /* Typography */
  --font-system: 'Inter', -apple-system, sans-serif;
  --letter-spacing-tight: -0.022em;
  --letter-spacing-normal: -0.01em;
  --line-height-compact: 1.2;
  --line-height-readable: 1.45;

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.92);
  --glass-border: rgba(255, 255, 255, 0.5);

  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* --- 3. Global Reset — Inter ONLY on text, NEVER on ::before/::after --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body,
input,
textarea,
button,
select,
h1,
h2,
h3,
h4,
h5,
h6,
p,
span,
a,
div,
li,
td,
th,
label,
.form-title,
.form-description {
  font-family: var(--font-system);
}

body {
  background-color: var(--system-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  padding: var(--space-4);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: var(--letter-spacing-normal);
  line-height: var(--line-height-readable);
}

::-webkit-scrollbar {
  display: none;
}

html,
body {
  overscroll-behavior-y: none;
  overflow-x: hidden;
}

/* --- 4. Container (Squircle Card) --- */
.container.ios-style {
  width: 92%;
  max-width: 380px;
  padding: var(--space-6) var(--space-5);
  background: var(--system-white);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.03),
    0 6px 20px rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-xl);
  /* 28px */
  border: 0.5px solid rgba(0, 0, 0, 0.04);
}

/* --- 5. Brand Section --- */
.brand-section {
  text-align: center;
  margin-bottom: var(--space-6);
}

.brand-logo img {
  width: 64px;
  height: auto;
  margin-bottom: var(--space-3);
}

.form-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--label-primary);
  margin: 0 0 var(--space-1);
  letter-spacing: var(--letter-spacing-tight);
  line-height: var(--line-height-compact);
}

.form-description {
  font-size: 0.78rem;
  color: var(--label-tertiary);
  font-weight: 500;
}

/* --- 6. Logo Upload (Squircle) --- */
.logo-upload-ios {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-5);
}

.logo-preview-wrapper {
  position: relative;
  width: 100px;
  height: 100px;
  background: var(--system-fill);
  border-radius: var(--radius-lg);
  /* 20px — Squircle */
  overflow: hidden;
  cursor: pointer;
  border: 1.5px solid var(--system-separator);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.logo-preview-wrapper:active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.logo-preview-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-overlay {
  position: absolute;
  bottom: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: var(--space-1) 0;
  text-align: center;
  color: #FFFFFF;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: var(--letter-spacing-normal);
}

/* --- 7. Input Group Stack (iOS Style) --- */
.ios-input-group {
  background: var(--system-fill);
  border-radius: var(--radius-sm);
  /* 10px */
  overflow: hidden;
  margin-bottom: var(--space-5);
  border: 0.5px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ios-input-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.08);
}

/* --- 8. Form Group (with Icons) --- */
.form-group {
  position: relative;
  border-bottom: 0.5px solid var(--system-separator);
}

.form-group:last-child {
  border-bottom: none;
}

/* Input Icon (Left side) */
.input-icon {
  position: absolute;
  left: var(--space-4);
  /* 16px */
  top: 50%;
  transform: translateY(-50%);
  color: var(--label-tertiary);
  font-size: 0.95rem;
  z-index: 1;
  pointer-events: none;
  transition: color 0.2s ease;
}

/* Input icon turns primary on focus */
.form-group:focus-within .input-icon {
  color: var(--primary);
}

/* Input Field — with icon padding */
.form-input {
  width: 100%;
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-10);
  /* 12px 16px 12px 40px */
  border: none;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 500;
  outline: none;
  color: var(--label-primary);
  letter-spacing: var(--letter-spacing-normal);
  height: 48px;
  text-align: start;
}

.form-input::placeholder {
  color: var(--label-quaternary);
  font-weight: 400;
}

/* RTL — icon on the right */
[dir="rtl"] .form-input {
  padding: var(--space-3) var(--space-10) var(--space-3) var(--space-4);
  text-align: right;
}

[dir="rtl"] .input-icon {
  left: auto;
  right: var(--space-4);
}

/* --- 9. Password Group --- */
.password-group {
  position: relative;
  display: flex;
  align-items: center;
}

.password-group .input-icon {
  left: var(--space-4);
}

[dir="rtl"] .password-group .input-icon {
  left: auto;
  right: var(--space-4);
}

/* Toggle Password */
.toggle-password {
  position: absolute;
  right: var(--space-3);
  left: auto;
  color: var(--label-tertiary);
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: all 0.2s ease;
  font-size: 0.85rem;
}

[dir="rtl"] .toggle-password {
  right: auto;
  left: var(--space-3);
}

.toggle-password:active {
  background: rgba(0, 0, 0, 0.06);
  color: var(--label-primary);
}

/* --- 10. Options Section --- */
.ios-options-section {
  margin-bottom: var(--space-5);
  padding: 0 var(--space-1);
}

/* Checkbox */
.checkbox-group.ios-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--label-secondary);
  cursor: pointer;
  letter-spacing: var(--letter-spacing-normal);
}

.checkbox-group.ios-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

/* Checkbox icon */
.checkbox-group label i {
  margin-right: var(--space-2);
  color: var(--system-blue);
  font-size: 0.75rem;
}

/* --- 11. Submit Button --- */
.submit-btn.ios-btn {
  width: 100%;
  padding: var(--space-3);
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  /* 14px */
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: var(--letter-spacing-normal);
  transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
  box-shadow: 0 4px 14px rgba(255, 107, 53, 0.22);
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.submit-btn.ios-btn:active {
  transform: scale(0.97);
  background: var(--primary-light);
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.15);
}

/* Submit button icon */
.submit-btn i {
  font-size: 0.85rem;
}

/* --- 12. Footer Link --- */
.footer-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--label-secondary);
  margin-top: var(--space-4);
}

.footer-link i {
  color: var(--primary);
  font-size: 0.7rem;
}

.footer-link a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

/* --- 13. Overlay & Popup (Glass Alert) --- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: none;
}

.message-box.ios-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 270px;
  background: var(--glass-bg);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-radius: var(--radius-lg);
  /* 20px */
  z-index: 1001;
  display: none;
  overflow: hidden;
  box-shadow: var(--shadow-float);
  border: 0.5px solid var(--glass-border);
  animation: modalIn 0.25s ease-out;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.92);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.ios-alert-content {
  padding: var(--space-5);
  text-align: center;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--label-primary);
  line-height: var(--line-height-readable);
}

.ios-alert-actions {
  border-top: 0.5px solid var(--system-separator);
  padding: var(--space-3);
  display: flex;
}

.ios-link-bold {
  flex: 1;
  color: var(--system-blue);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  padding: var(--space-2);
  cursor: pointer;
  letter-spacing: var(--letter-spacing-normal);
  text-align: center;
  transition: background 0.15s ease;
  border-radius: var(--radius-xs);
}

.ios-link-bold:active {
  background: rgba(0, 0, 0, 0.04);
}

/* Destructive link */
.ios-link-bold.destructive {
  color: var(--system-red);
  font-weight: 700;
}

.ios-link-bold+.ios-link-bold {
  border-left: 0.5px solid var(--system-separator);
}

/* --- 14. Responsive --- */
@media (max-width: 380px) {
  .container.ios-style {
    width: 96%;
    padding: var(--space-5) var(--space-4);
  }

  .form-title {
    font-size: 1.15rem;
  }

  .form-input {
    height: 44px;
    font-size: 0.85rem;
  }

  .submit-btn.ios-btn {
    height: 44px;
    font-size: 0.9rem;
  }

  .logo-preview-wrapper {
    width: 88px;
    height: 88px;
  }
}

@media (min-width: 768px) {
  .container.ios-style {
    max-width: 400px;
    padding: var(--space-8);
  }
}