*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: linear-gradient(135deg, #e8f4fd 0%, #c9e6f8 50%, #ddeeff 100%);
  font-family:
    "Segoe UI",
    system-ui,
    -apple-system,
    sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.card {
  background: #ffffff;
  border-radius: 12px;
  width: 100%;
  max-width: 460px;
  padding: 12px 40px 40px 40px;
  position: relative;
  overflow: hidden;
}

.card::after,
.card::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #1a8cff, #0066cc);
  border-radius: 24px 24px 0 0;
}

.card::before {
  top: 0;
}

/* Logo */
.logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
  gap: 14px;
}

.logo-svg {
  width: 72px;
  height: 72px;
}

.brand-name {
  font-size: 22px;
  font-weight: 800;
  color: #0078d4;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.brand-sub {
  font-size: 13px;
  color: #6b8caa;
  margin-top: -10px;
  letter-spacing: 0.5px;
}

/* Form fields */
.field {
  margin-bottom: 20px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #3a5a7a;
  margin-bottom: 7px;
  letter-spacing: 0.3px;
}

input[type="text"],
input[type="tel"],
input[type="number"] {
  width: 100%;
  padding: 13px 16px;
  border: 1.8px solid #d0e6f7;
  border-radius: 12px;
  font-size: 15px;
  color: #1a2e40;
  background: #f5faff;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    background 0.2s;
}

input[type="text"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus {
  border-color: #1a8cff;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(26, 140, 255, 0.1);
}

input::placeholder {
  color: #aac4db;
}

/* Direction toggle */
.toggle-group {
  display: flex;
  gap: 10px;
}

.toggle-group input[type="radio"] {
  display: none;
}

.toggle-group label {
  flex: 1;
  text-align: center;
  padding: 12px 0;
  border: 1.8px solid #d0e6f7;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  color: #5a88aa;
  background: #f5faff;
  cursor: pointer;
  transition: all 0.2s;
  margin: 0;
}

.toggle-group input[type="radio"]:checked + label {
  background: linear-gradient(135deg, #1a8cff, #0066cc);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(26, 140, 255, 0.3);
}

/* Submit button */
@keyframes shimmer {
  0%   { transform: translateX(-120%) skewX(-20deg); }
  100% { transform: translateX(220%) skewX(-20deg); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 6px 20px rgba(26, 140, 255, 0.4), 0 0 0 0 rgba(26, 140, 255, 0.35); }
  50%       { box-shadow: 0 8px 28px rgba(26, 140, 255, 0.6), 0 0 0 8px rgba(26, 140, 255, 0); }
}

.btn-submit {
  margin-top: 12px;
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #1a8cff 0%, #0066ff 50%, #0044cc 100%);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(26, 140, 255, 0.4);
  animation: pulse-glow 2.4s ease-in-out infinite;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  text-shadow: 0 1px 4px rgba(0, 40, 120, 0.25);
}

/* shimmer sweep */
.btn-submit::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.45) 50%,
    transparent 100%
  );
  animation: shimmer 2.4s ease-in-out infinite;
  pointer-events: none;
}

.btn-submit:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 32px rgba(26, 140, 255, 0.55);
  animation: none;
}
.btn-submit:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 4px 12px rgba(26, 140, 255, 0.35);
}
.btn-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  animation: none;
}
.btn-submit:disabled::before {
  display: none;
}

/* Status message */
.status {
  margin-top: 18px;
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  display: none;
}

.status.success {
  display: block;
  background: #e6f9ef;
  color: #1a7a45;
  border: 1.5px solid #a8e6c1;
}

.status.error {
  display: block;
  background: #fdecea;
  color: #b5261e;
  border: 1.5px solid #f5b4b0;
}

/* Separator */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, #d0e6f7, transparent);
  margin: 8px 0 24px;
}

/* Responsive */
@media (max-width: 520px) {
  .card {
    padding: 12px 24px 24px;
  }
}

/* ===================== SUCCESS MODAL ===================== */
@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes modalPop {
  0%   { opacity: 0; transform: scale(0.6) translateY(40px); }
  70%  { transform: scale(1.04) translateY(-6px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes checkBounce {
  0%   { transform: scale(0) rotate(-20deg); }
  60%  { transform: scale(1.2) rotate(5deg); }
  100% { transform: scale(1) rotate(0); }
}

@keyframes floatUp {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-120px) scale(0.5); }
}

@keyframes titleGlow {
  0%, 100% { text-shadow: 0 0 8px rgba(34,197,94,0.3); }
  50%       { text-shadow: 0 0 22px rgba(34,197,94,0.7), 0 0 40px rgba(34,197,94,0.3); }
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 20, 60, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
  animation: overlayIn 0.3s ease;
}

.modal-box {
  background: #fff;
  border-radius: 24px;
  max-width: 420px;
  width: 100%;
  padding: 48px 36px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: modalPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  box-shadow: 0 30px 80px rgba(0, 80, 200, 0.22), 0 6px 20px rgba(0,0,0,0.1);
}

.modal-box::before,
.modal-box::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #22c55e, #16a34a);
}
.modal-box::before { top: 0; }
.modal-box::after  { bottom: 0; }

.modal-icon {
  margin: 0 auto 20px;
  width: 80px;
  height: 80px;
  animation: checkBounce 0.6s 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  filter: drop-shadow(0 8px 18px rgba(34,197,94,0.5));
}

.modal-title {
  font-size: 22px;
  font-weight: 800;
  color: #16a34a;
  margin-bottom: 12px;
  animation: titleGlow 2.5s ease-in-out infinite;
}

.modal-text {
  font-size: 14px;
  color: #5a78a0;
  line-height: 1.6;
  margin-bottom: 28px;
}

.modal-tg-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(34,197,94,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
  margin-bottom: 14px;
  letter-spacing: 0.3px;
}

.modal-tg-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(34,197,94,0.5);
}

.modal-close {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 12px;
  background: none;
  border: 1.8px solid #d0e6f7;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #7aaace;
  cursor: pointer;
  transition: all 0.15s;
}

.modal-close:hover {
  background: #f0f8ff;
  color: #0066cc;
  border-color: #1a8cff;
}

/* Confetti particles */
.modal-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: floatUp 1.2s ease-out forwards;
}

@media (max-width: 480px) {
  .modal-box { padding: 36px 22px 30px; }
  .modal-title { font-size: 19px; }
}
