* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  font-family:
    "Plus Jakarta Sans",
    system-ui,
    -apple-system,
    sans-serif;
  background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
  color: #1e293b;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 32px 20px;
  padding: max(32px, env(safe-area-inset-top)) 20px max(32px, env(safe-area-inset-bottom));
}

.form-card {
  width: 100%;
  max-width: 560px;
  background: #ffffff;
  padding: 40px;
  border-radius: 20px;
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.04),
    0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

h1 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 28px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0;
}

.subtitle {
  margin-top: 0;
  color: #64748b;
  line-height: 1.6;
  font-size: 15px;
  margin-bottom: 24px;
}

.status {
  padding: 14px 18px;
  border-radius: 12px;
  margin: 0 0 24px 0;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.status.online {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #dcfce7;
}

.status.online::before {
  content: "●";
  color: #22c55e;
  font-size: 20px;
  line-height: 1;
}

.status.offline {
  background: #fffbeb;
  color: #c2410c;
  border: 1px solid #fef3c7;
}

.status.offline::before {
  content: "●";
  color: #f59e0b;
  font-size: 20px;
  line-height: 1;
}

.form-group {
  margin-bottom: 20px;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
  color: #334155;
  transition: color 0.2s;
}

input[type="text"],
input[type="tel"],
input[type="email"],
textarea,
select {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  font-size: 16px;
  font-family: inherit;
  background: #f8fafc;
  color: #1e293b;
  transition: all 0.2s ease;
}

select {
  appearance: auto;
}

textarea {
  resize: vertical;
  min-height: 100px;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #ef4444;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.error-text {
  display: block;
  margin-top: 8px;
  color: #ef4444;
  font-size: 13px;
  font-weight: 500;
}

.submit-btn,
.secondary-btn {
  width: 100%;
  min-height: 54px;
  border: none;
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.2s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.submit-btn {
  background: #dc2626;
  color: #ffffff;
  box-shadow:
    0 4px 6px -1px rgba(220, 38, 38, 0.2),
    0 2px 4px -2px rgba(220, 38, 38, 0.2);
  margin-top: 10px;
}

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

.submit-btn:disabled,
.secondary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
  transform: none;
}

.secondary-btn {
  background: #f1f5f9;
  color: #0f172a;
  margin-top: 12px;
}

.sync-box {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #f1f5f9;
  text-align: center;
}

.sync-box p {
  margin: 0 0 12px 0;
  color: #64748b;
  font-size: 14px;
}

.sync-box strong {
  color: #0f172a;
  font-size: 16px;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 6px;
  margin-left: 6px;
}

.message {
  margin-top: 20px;
  padding: 14px 18px;
  border-radius: 12px;
  display: none;
  font-size: 14px;
  font-weight: 500;
  animation: fadeIn 0.3s ease;
}

.message.success {
  display: block;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #dcfce7;
}

.message.error {
  display: block;
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fee2e2;
}

.message.info {
  display: block;
  background: #f0f9ff;
  color: #075985;
  border: 1px solid #e0f2fe;
}

@media (hover: hover) and (pointer: fine) {
  input:hover,
  textarea:hover,
  select:hover {
    border-color: #94a3b8;
  }

  .submit-btn:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow:
      0 6px 8px -1px rgba(220, 38, 38, 0.3),
      0 4px 6px -2px rgba(220, 38, 38, 0.2);
  }

  .secondary-btn:hover {
    background: #e2e8f0;
    color: #000000;
  }
}

@media (max-width: 480px) {
  .page {
    align-items: flex-start;
    padding: 16px 12px;
    padding: max(16px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom));
  }

  .form-card {
    padding: 20px 16px;
    border-radius: 14px;
    box-shadow:
      0 12px 28px rgba(0, 0, 0, 0.05),
      0 1px 2px rgba(0, 0, 0, 0.04);
  }

  h1 {
    font-size: 24px;
    line-height: 1.2;
  }

  .subtitle {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
  }

  .status,
  .message {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
  }

  .form-group {
    margin-bottom: 16px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .submit-btn,
  .secondary-btn {
    min-height: 52px;
    padding: 14px 16px;
    font-size: 15px;
  }

  .sync-box {
    margin-top: 24px;
    padding-top: 20px;
  }
}

@media (min-width: 481px) and (max-width: 767px) {
  .page {
    align-items: flex-start;
    padding: 24px 18px;
    padding: max(24px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
  }

  .form-card {
    max-width: 620px;
    padding: 28px;
    border-radius: 16px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }
}

@media (min-width: 768px) and (max-width: 1180px) {
  .page {
    padding: 36px 32px;
    padding: max(36px, env(safe-area-inset-top)) 32px max(36px, env(safe-area-inset-bottom));
  }

  .form-card {
    max-width: 720px;
    padding: 40px;
  }
}

@media (max-height: 720px) and (orientation: landscape) {
  .page {
    align-items: flex-start;
  }

  .form-card {
    max-width: 760px;
  }
}
