/* Yekan Bakh font faces */
@font-face {
  font-family: 'Yekan Bakh';
  src: url('assets/fonts/Yekan Bakh/Fa/Yekan Bakh FA 04 Regular.woff') format('woff'),
       url('assets/fonts/Yekan Bakh/Fa/Yekan Bakh FA 04 Regular.ttf') format('truetype'),
       url('assets/fonts/Yekan Bakh/Fa/Yekan Bakh FA 04 Regular.eot');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C;
}
@font-face {
  font-family: 'Yekan Bakh';
  src: url('assets/fonts/Yekan Bakh/Fa/Yekan Bakh FA 05 Medium.woff') format('woff'),
       url('assets/fonts/Yekan Bakh/Fa/Yekan Bakh FA 05 Medium.ttf') format('truetype'),
       url('assets/fonts/Yekan Bakh/Fa/Yekan Bakh FA 05 Medium.eot');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C;
}
@font-face {
  font-family: 'Yekan Bakh';
  src: url('assets/fonts/Yekan Bakh/Fa/Yekan Bakh FA 06 Bold.woff') format('woff'),
       url('assets/fonts/Yekan Bakh/Fa/Yekan Bakh FA 06 Bold.ttf') format('truetype'),
       url('assets/fonts/Yekan Bakh/Fa/Yekan Bakh FA 06 Bold.eot');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C;
}

* {
  box-sizing: border-box;
}

body {
  background-color: #FFFFFF;
  font-family: 'Yekan Bakh', -apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  direction: ltr;
}

html {
  font-family: 'Yekan Bakh', -apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

button, input {
  font: inherit;
}

.landing-container {
  width: 100%;
  max-width: 800px;
  padding: 40px 20px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.content-wrapper {
  background-color: #FFFFFF;
  padding: 40px 30px;
  border-radius: 16px;
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.title {
  font-size: 28px;
  font-weight: 700;
  color: #000000;
  margin: 0 0 16px 0;
  line-height: 1.4;
  direction: rtl;
  text-align: center;
}

.title .highlight {
  color: #007bff;
}

.subtitle-wrapper {
  width: 100%;
  max-width: 600px;
  margin: 0 auto 32px auto;
  position: relative;
}

.subtitle-wrapper.state-success {
  margin-bottom: 16px;
}

.subtitle {
  font-size: 16px;
  font-weight: 400;
  color: #666666;
  margin: 0;
  line-height: 1.6;
  direction: rtl;
  text-align: center;
  padding: 16px 20px;
  border-radius: 12px;
  background-color: #FFFFFF;
  transition: all 0.3s ease;
}

.subtitle-wrapper.state-success .subtitle {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.subtitle-wrapper.state-warning .subtitle {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.subtitle-wrapper.state-error .subtitle {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.subtitle.form-hidden {
  margin-bottom: 0;
}

.ppq-check-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  direction: rtl;
  max-width: 100%;
}

.phone-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  direction: rtl;
  max-width: 100%;
}

.retry-check-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  direction: rtl;
  max-width: 100%;
  margin-top: 16px;
}

.form-group {
  width: 100%;
}

.phone-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #E5E7EB;
  border-radius: 10px;
  font-size: 16px;
  background-color: #FFFFFF;
  color: #000000;
  direction: ltr;
  text-align: left;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.phone-input::placeholder {
  color: #8B8B8B;
  direction: ltr;
}

.phone-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.12);
}

.phone-input:disabled {
  background-color: #F5F5F5;
  cursor: not-allowed;
  opacity: 0.6;
}

.submit-btn {
  width: 100%;
  padding: 12px 24px;
  background-color: #007bff;
  color: #FFFFFF;
  border: none;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.08s ease;
  direction: rtl;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.submit-btn:hover:not(:disabled) {
  background-color: #0069d9;
}

.submit-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.submit-btn:disabled {
  background-color: #D1D1D1;
  cursor: not-allowed;
  transform: none;
}

.retry-btn {
  width: 100%;
  padding: 12px 24px;
  background-color: transparent;
  color: #007bff;
  border: 1.5px solid #007bff;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.08s ease;
  direction: rtl;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.retry-btn:hover:not(:disabled) {
  background-color: #007bff;
  color: #FFFFFF;
}

.retry-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.retry-btn:disabled {
  border-color: #D1D1D1;
  color: #D1D1D1;
  cursor: not-allowed;
  transform: none;
}

.btn-spinner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-spinner svg {
  animation: spin 0.75s linear infinite;
}

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

/* Status Section */
.status-section {
  width: 100%;
  direction: rtl;
}

.status-section-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 16px 0;
  letter-spacing: -0.2px;
  text-align: right;
}

.status-card {
  padding: 24px 24px 20px;
  background-color: #FFFFFF;
  border: 1px solid rgba(0, 123, 255, 0.22);
  border-right: 4px solid #007bff;
  border-radius: 14px;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 10px 30px rgba(0, 123, 255, 0.10);
  position: relative;
}

.status-card:hover {
  box-shadow: 0 14px 40px rgba(0, 123, 255, 0.16);
  transform: translateY(-1px);
  border-color: rgba(0, 123, 255, 0.35);
}

.status-image-container {
  width: 100%;
  margin: 0 auto 16px auto;
  border-radius: 10px;
  overflow: hidden;
  max-height: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.status-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  max-width: 100%;
  margin: 0 auto;
}

.status-text {
  font-size: 15px;
  color: #334155;
  margin: 0 0 14px 0;
  line-height: 1.8;
}

.status-date {
  font-size: 13px;
  color: #007bff;
  margin: 0;
  font-weight: 700;
  background: rgba(0, 123, 255, 0.10);
  border: 1px solid rgba(0, 123, 255, 0.18);
  padding: 6px 10px;
  border-radius: 999px;
}

/* Info Section */
.info-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  direction: rtl;
}

.info-card {
  padding: 24px;
  background-color: #FFFFFF;
  border: 1px solid #F0F0F0;
  border-radius: 12px;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: box-shadow 0.2s ease;
}

.info-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.icon-wrapper {
  width: 40px;
  height: 40px;
  background: rgba(0, 123, 255, 0.08);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #007bff;
  margin-bottom: 16px;
}

.info-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: #333333;
  margin: 0 0 8px 0;
}

.info-card p {
  font-size: 14px;
  color: #666666;
  margin: 0;
  line-height: 1.6;
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: #333333;
  color: #FFFFFF;
  padding: 16px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 400;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
  z-index: 1000;
  max-width: 90%;
  text-align: center;
  direction: rtl;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  background-color: #28a745;
}

.toast.warning {
  background-color: #ffc107;
  color: #000000;
}

/* Animation Styles */
.animation-section {
  width: 100%;
  padding: 20px 0 30px;
  display: flex;
  justify-content: center;
  direction: ltr;
}

.animation-container {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  max-width: 500px;
  position: relative;
}

.node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 2;
  position: relative;
  width: 80px;
}

.icon-box {
  width: 56px;
  height: 56px;
  background-color: #f8f9fa;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  border: 2px solid #e9ecef;
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
}

.node.phone .icon-box {
  animation: highlightPhone 4s infinite;
}

.node.internet .icon-box {
  animation: highlightInternet 4s infinite;
}

.node.apple .icon-box {
  animation: highlightApple 4s infinite;
}

.label {
  font-size: 13px;
  font-weight: 500;
  color: #6c757d;
  text-align: center;
  white-space: nowrap;
}

.connector {
  flex: 1;
  height: 3px;
  background-color: #e9ecef;
  position: relative;
  margin: 28px -10px 0; /* Top margin half of icon height, negative side margins for overlap */
  transform: translateY(-50%);
  z-index: 1;
  min-width: 40px;
}

.connector .line {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  opacity: 0;
}

.dot.success {
  background-color: #28a745;
  box-shadow: 0 0 6px rgba(40, 167, 69, 0.4);
  animation: moveSuccess 4s infinite linear;
}

.dot.failure {
  background-color: #dc3545;
  box-shadow: 0 0 6px rgba(220, 53, 69, 0.4);
  animation: moveFail 4s infinite linear;
}

.error-cross {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  color: #dc3545;
  font-weight: 900;
  font-size: 18px;
  line-height: 1;
  z-index: 4;
  animation: showError 4s infinite;
  background-color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Success state (Apple reachable): make connectors green with animation */
.animation-container.apple-reachable .connector {
  background-color: #28a745;
  position: relative;
  overflow: visible;
  height: 4px;
  border-radius: 2px;
}

.animation-container.apple-reachable .connector::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.5),
    transparent
  );
  animation: greenPulse 2s infinite;
  z-index: 2;
  border-radius: 2px;
}

.animation-container.apple-reachable .connector .line {
  background-color: #28a745;
  border-radius: 2px;
  animation: greenGlow 2s infinite ease-in-out;
}

.animation-container.apple-reachable .dot.success {
  background-color: #28a745;
  box-shadow: 0 0 10px rgba(40, 167, 69, 0.7);
  width: 12px;
  height: 12px;
  animation: moveSuccessFirst 4s infinite linear;
}

.animation-container.apple-reachable .dot.failure {
  background-color: #28a745;
  box-shadow: 0 0 10px rgba(40, 167, 69, 0.7);
  animation: moveSuccessSecondSequenced 4s infinite linear;
  width: 12px;
  height: 12px;
}

.animation-container.apple-reachable .error-cross {
  display: none;
}

.animation-container.apple-reachable .node.phone .icon-box {
  animation: highlightPhoneSuccess 4s infinite;
}

.animation-container.apple-reachable .node.internet .icon-box {
  animation: highlightInternetSuccess 4s infinite;
}

.animation-container.apple-reachable .node.apple .icon-box {
  animation: highlightAppleSuccess 4s infinite;
}

/* Green connector animations */
@keyframes greenPulse {
  0% {
    left: -100%;
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    left: 100%;
    opacity: 0;
  }
}

@keyframes greenGlow {
  0%, 100% {
    box-shadow: 0 0 6px rgba(40, 167, 69, 0.4), 
                0 0 12px rgba(40, 167, 69, 0.2);
  }
  50% {
    box-shadow: 0 0 12px rgba(40, 167, 69, 0.7), 
                0 0 20px rgba(40, 167, 69, 0.4);
  }
}

@keyframes moveSuccess {
  0% { left: 0; opacity: 0; }
  5% { opacity: 1; }
  35% { left: 100%; opacity: 1; }
  40% { left: 100%; opacity: 0; }
  100% { left: 100%; opacity: 0; }
}

@keyframes moveFail {
  0% { left: 0; opacity: 0; }
  35% { left: 0; opacity: 0; }
  40% { left: 0; opacity: 1; }
  60% { left: 50%; opacity: 1; }
  80% { left: 50%; opacity: 1; }
  85% { left: 50%; opacity: 0; }
  100% { left: 50%; opacity: 0; }
}

@keyframes moveSuccessSecond {
  0%, 35% { left: 0; opacity: 0; }
  40% { left: 0; opacity: 1; }
  85% { left: 100%; opacity: 1; }
  90% { left: 100%; opacity: 0; }
  100% { left: 100%; opacity: 0; }
}

@keyframes moveSuccessFirst {
  0% { left: 0; opacity: 0; }
  5% { opacity: 1; }
  35% { left: 100%; opacity: 1; }
  40% { left: 100%; opacity: 0; }
  100% { left: 100%; opacity: 0; }
}

@keyframes moveSuccessSecondSequenced {
  0%, 40% { left: 0; opacity: 0; }
  42% { left: 0; opacity: 1; }
  87% { left: 100%; opacity: 1; }
  92% { left: 100%; opacity: 0; }
  100% { left: 100%; opacity: 0; }
}

@keyframes showError {
  0%, 60% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  65% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
  70% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  85% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  90% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  100% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
}

@keyframes highlightPhone {
  0%, 5% { border-color: #007bff; color: #007bff; background-color: #e6f0ff; transform: scale(1.05); }
  35% { border-color: #e9ecef; color: #6c757d; background-color: #f8f9fa; transform: scale(1); }
  100% { border-color: #e9ecef; color: #6c757d; background-color: #f8f9fa; transform: scale(1); }
}

@keyframes highlightInternet {
  0%, 30% { border-color: #e9ecef; color: #6c757d; background-color: #f8f9fa; transform: scale(1); }
  35%, 40% { border-color: #007bff; color: #007bff; background-color: #e6f0ff; transform: scale(1.05); }
  65% { border-color: #e9ecef; color: #6c757d; background-color: #f8f9fa; transform: scale(1); }
  100% { border-color: #e9ecef; color: #6c757d; background-color: #f8f9fa; transform: scale(1); }
}

@keyframes highlightApple {
  0%, 60% { border-color: #e9ecef; color: #6c757d; background-color: #f8f9fa; }
  65%, 85% { border-color: #dc3545; color: #dc3545; background-color: #fff5f5; }
  100% { border-color: #e9ecef; color: #6c757d; background-color: #f8f9fa; }
}

@keyframes highlightPhoneSuccess {
  0%, 35% { border-color: #28a745; color: #28a745; background-color: #f3fff5; transform: scale(1.05); }
  40% { border-color: #e9ecef; color: #6c757d; background-color: #f8f9fa; transform: scale(1); }
  100% { border-color: #e9ecef; color: #6c757d; background-color: #f8f9fa; transform: scale(1); }
}

@keyframes highlightInternetSuccess {
  0%, 30% { border-color: #e9ecef; color: #6c757d; background-color: #f8f9fa; transform: scale(1); }
  35%, 42% { border-color: #28a745; color: #28a745; background-color: #f3fff5; transform: scale(1.05); }
  65% { border-color: #e9ecef; color: #6c757d; background-color: #f8f9fa; transform: scale(1); }
  100% { border-color: #e9ecef; color: #6c757d; background-color: #f8f9fa; transform: scale(1); }
}

@keyframes highlightAppleSuccess {
  0%, 85% { border-color: #e9ecef; color: #6c757d; background-color: #f8f9fa; transform: scale(1); }
  87%, 92% { border-color: #28a745; color: #28a745; background-color: #f3fff5; transform: scale(1.05); }
  100% { border-color: #e9ecef; color: #6c757d; background-color: #f8f9fa; transform: scale(1); }
}

@media (max-width: 600px) {
  .landing-container {
    padding: 20px;
  }
  
  .content-wrapper {
    padding: 30px 20px;
  }
  
  .title {
    font-size: 24px;
  }
  
  .subtitle {
    font-size: 14px;
  }
  
  .info-section {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .toast {
    width: calc(100% - 20px);
    max-width: calc(100% - 20px);
  }

  /* Animation responsive adjustments */
  .icon-box { width: 48px; height: 48px; }
  .connector { min-width: 30px; margin-top: 24px; }
  .label { font-size: 11px; }
}
