/* ============================================================
   SMTP CREDENTIAL TESTER — MODERN UI
============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

* {
  box-sizing: border-box;
}

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #8b5cf6;

  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;

  --bg-dark: #0f172a;
  --bg-card: rgba(255, 255, 255, 0.96);

  --text-dark: #111827;
  --text-muted: #64748b;

  --border: #e2e8f0;
  --radius: 16px;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  background:
    radial-gradient(circle at top left, rgba(99, 102, 241, 0.25), transparent 35%),
    radial-gradient(circle at bottom right, rgba(139, 92, 246, 0.18), transparent 35%),
    #f1f5f9;

  color: var(--text-dark);
  min-height: 100vh;
}


/* ============================================================
   CONTAINER
============================================================ */

.container {
  width: min(1150px, calc(100% - 40px));
  margin: 0 auto;
  padding: 50px 0 70px;
}


/* ============================================================
   HEADER
============================================================ */

header {
  margin-bottom: 38px;
  text-align: center;
}

header h1 {
  margin: 0 0 12px;

  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -1.2px;

  background: linear-gradient(135deg, #4f46e5, #9333ea);

  background-clip: text;
  -webkit-background-clip: text;

  -webkit-text-fill-color: transparent;
}

header p {
  margin: 0;
  color: #64748b;
  font-size: 15px;
}

/* ============================================================
   FLOW STEPS
============================================================ */

.flow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.flow-step {
  flex: 1;

  display: flex;
  align-items: center;
  gap: 12px;

  padding: 18px;

  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);

  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--radius);

  box-shadow: 0 8px 25px rgba(15, 23, 42, 0.04);

  transition: all 0.3s ease;
}

.flow-step:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(79, 70, 229, 0.12);
}

.flow-step .number {
  width: 38px;
  height: 38px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 12px;

  background: #eef2ff;
  color: #6366f1;

  font-weight: 800;
  font-size: 14px;

  flex-shrink: 0;
}

.flow-step strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
}

.flow-step small {
  display: block;
  margin-top: 5px;
  color: #94a3b8;
  font-size: 12px;
}

.flow-step.active {
  border-color: #818cf8;
  background: linear-gradient(135deg, #eef2ff, #ffffff);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.15);
}

.flow-step.active .number {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
}

.flow-step.success {
  border-color: #34d399;
  background: #ecfdf5;
}

.flow-step.success .number {
  background: #10b981;
  color: white;
}

.flow-step.error {
  border-color: #f87171;
  background: #fef2f2;
}

.flow-step.error .number {
  background: #ef4444;
  color: white;
}

.arrow {
  font-size: 24px;
  font-weight: 600;
  color: #cbd5e1;
}


/* ============================================================
   BACKEND STATUS
============================================================ */

.status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 17px 22px;
  margin-bottom: 25px;

  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);

  border: 1px solid #e2e8f0;
  border-radius: var(--radius);

  box-shadow: 0 8px 25px rgba(15, 23, 42, 0.04);
}

.status-card > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-card strong {
  font-size: 14px;
}

#backendStatus {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}

.status-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;

  background: #94a3b8;
  position: relative;
}

.status-dot.online {
  background: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}

.status-dot.offline {
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}


/* ============================================================
   CARDS
============================================================ */

.card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(14px);

  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--radius);

  padding: 28px;
  margin-bottom: 24px;

  box-shadow:
    0 10px 30px rgba(15, 23, 42, 0.05),
    0 2px 6px rgba(15, 23, 42, 0.03);

  transition: box-shadow 0.3s ease;
}

.card:hover {
  box-shadow:
    0 15px 40px rgba(15, 23, 42, 0.08),
    0 4px 10px rgba(15, 23, 42, 0.04);
}

.card h2 {
  margin: 0 0 25px;

  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;

  display: flex;
  align-items: center;
  gap: 10px;
}

.card h2::before {
  content: "";
  width: 4px;
  height: 20px;

  border-radius: 4px;

  background: linear-gradient(180deg, #6366f1, #8b5cf6);
}


/* ============================================================
   FORMS
============================================================ */

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group.full {
  grid-column: 1 / -1;
}

label {
  font-size: 12px;
  font-weight: 700;
  color: #475569;

  text-transform: uppercase;
  letter-spacing: 0.4px;
}

input,
select,
textarea {
  width: 100%;

  padding: 13px 15px;

  border: 1px solid #e2e8f0;
  border-radius: 10px;

  font-size: 14px;
  font-family: inherit;

  background: #f8fafc;
  color: #1e293b;

  outline: none;

  transition: all 0.25s ease;
}

input::placeholder,
textarea::placeholder {
  color: #94a3b8;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #cbd5e1;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #6366f1;
  background: #ffffff;

  box-shadow:
    0 0 0 4px rgba(99, 102, 241, 0.1);
}

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


/* ============================================================
   PASSWORD
============================================================ */

.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 80px;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);

  border: none;
  background: transparent;

  color: #6366f1;
  font-size: 12px;
  font-weight: 700;

  cursor: pointer;
  padding: 6px 8px;

  border-radius: 6px;

  transition: background 0.2s ease;
}

.password-toggle:hover {
  background: #eef2ff;
}


/* ============================================================
   TEST BUTTON
============================================================ */

.test-button {
  width: 100%;

  padding: 17px 20px;

  border: none;
  border-radius: 12px;

  background: linear-gradient(135deg, #4f46e5, #7c3aed);

  color: white;

  font-size: 15px;
  font-weight: 700;

  letter-spacing: 0.2px;

  cursor: pointer;

  box-shadow:
    0 8px 20px rgba(99, 102, 241, 0.25);

  transition: all 0.3s ease;

  position: relative;
  overflow: hidden;
}

.test-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;

  width: 100%;
  height: 100%;

  background: linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,0.2),
    transparent
  );

  transition: left 0.5s ease;
}

.test-button:hover::before {
  left: 100%;
}

.test-button:hover {
  transform: translateY(-2px);

  box-shadow:
    0 12px 30px rgba(99, 102, 241, 0.35);
}

.test-button:active {
  transform: translateY(0);
}

.test-button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}


/* ============================================================
   TEST STAGES
============================================================ */

.stage-card {
  margin-top: 24px;
}

.stages {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stage {
  display: flex;
  align-items: center;
  gap: 16px;

  padding: 17px 18px;

  border: 1px solid #e2e8f0;
  border-radius: 12px;

  background: #f8fafc;

  transition: all 0.3s ease;
}

.stage-icon {
  width: 38px;
  height: 38px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 11px;

  background: #e2e8f0;
  color: #64748b;

  font-weight: 800;
  font-size: 13px;

  flex-shrink: 0;
}

.stage strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
}

.stage p {
  margin: 5px 0 0;
  color: #94a3b8;
  font-size: 12px;
}

.stage.active {
  border-color: #a5b4fc;
  background: #eef2ff;
  box-shadow: 0 5px 20px rgba(99, 102, 241, 0.08);
}

.stage.active .stage-icon {
  background: #6366f1;
  color: white;
}

.stage.success {
  border-color: #6ee7b7;
  background: #ecfdf5;
}

.stage.success .stage-icon {
  background: #10b981;
  color: white;
}

.stage.error {
  border-color: #fca5a5;
  background: #fef2f2;
}

.stage.error .stage-icon {
  background: #ef4444;
  color: white;
}


/* ============================================================
   RESULT
============================================================ */

.result-card {
  margin-bottom: 0;
}

.result {
  padding: 20px;

  border-radius: 12px;

  font-size: 14px;
  line-height: 1.6;

  transition: all 0.3s ease;
}

.result.waiting {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  color: #64748b;
}

.result.success {
  background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
  border: 1px solid #86efac;
  color: #065f46;
}

.result.error {
  background: linear-gradient(135deg, #fef2f2, #fff1f2);
  border: 1px solid #fca5a5;
  color: #991b1b;
}

.result-title {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 8px;
}

.result-message {
  margin-bottom: 15px;
}

.technical-details,
.success-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;

  margin-top: 18px;
}

.technical-details > div,
.success-details > div {
  padding: 13px;

  background: rgba(255, 255, 255, 0.7);

  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 9px;
}

.technical-details span,
.success-details span {
  display: block;

  margin-bottom: 5px;

  font-size: 10px;
  font-weight: 700;
  color: #64748b;

  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.technical-details strong,
.success-details strong {
  display: block;

  word-break: break-word;

  font-size: 13px;
  color: #1e293b;
}


/* ============================================================
   ANIMATIONS
============================================================ */

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
  }
}

.stage.active .stage-icon {
  animation: pulse 1.8s infinite;
}


/* ============================================================
   RESPONSIVE
============================================================ */

@media (max-width: 800px) {

  .container {
    width: min(100% - 24px, 650px);
    padding-top: 25px;
  }

  header {
    margin-bottom: 25px;
  }

  header h1 {
    font-size: 28px;
  }

  .flow {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .flow-step {
    flex: none;
  }

  .arrow {
    text-align: center;
    transform: rotate(90deg);
    font-size: 20px;
    height: 20px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .form-group.full {
    grid-column: auto;
  }

  .card {
    padding: 20px;
  }

  .technical-details,
  .success-details {
    grid-template-columns: 1fr;
  }

  .test-button {
    padding: 15px;
  }
}

@media (max-width: 480px) {

  .container {
    width: calc(100% - 20px);
  }

  header h1 {
    font-size: 25px;
  }

  header p {
    font-size: 13px;
  }

  .status-card {
    padding: 15px;
  }

  .card {
    padding: 17px;
    border-radius: 13px;
  }

  .card h2 {
    font-size: 16px;
  }
}