/**
 * Regulint Order Success Page Styles
 *
 * Mirrors the dashboard CheckoutSuccess.tsx component design
 *
 * @version 1.1.0
 */

/* ==========================================================================
   UI Scale Helper
   ========================================================================== */

:root {
  --os-px: calc(1px * var(--rp-ui-scale, 1));
}

/* ==========================================================================
   Page Container
   ========================================================================== */

.regulint-order-success-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  padding: calc(32 * var(--os-px)) calc(16 * var(--os-px));
  background-color: #f9fafb;
  width: 100%;
  box-sizing: border-box;
}

/* Override Astra theme container styles */
.regulint-order-success-page,
#regulint-order-success {
  max-width: 100% !important;
  margin: 0 auto;
}

/* Ensure content sections are centered */
.regulint-success-loading,
.regulint-success-content,
.regulint-success-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.regulint-success-loading {
  gap: calc(16 * var(--os-px));
}

.regulint-success-loading .regulint-spinner {
  width: calc(32 * var(--os-px));
  height: calc(32 * var(--os-px));
  border: calc(3 * var(--os-px)) solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: regulint-spin 1s linear infinite;
}

@keyframes regulint-spin {
  to {
    transform: rotate(360deg);
  }
}

.regulint-success-loading p {
  color: #6b7280;
  font-size: 1rem;
  margin: 0;
}

/* ==========================================================================
   Success Card
   ========================================================================== */

.regulint-success-card {
  width: max(min(45vw, 100%), calc(500 * var(--os-px)));
  max-width: 100vw;
  margin: 0 auto;
  padding: calc(32 * var(--os-px));
  background-color: #fff;
  border-radius: calc(12 * var(--os-px));
  box-shadow: 0 calc(4 * var(--os-px)) calc(6 * var(--os-px)) calc(-1 * var(--os-px)) rgba(0, 0, 0, 0.1), 0 calc(2 * var(--os-px)) calc(4 * var(--os-px)) calc(-1 * var(--os-px)) rgba(0, 0, 0, 0.06);
  box-sizing: border-box;
}

/* Header */
.regulint-success-header {
  text-align: center;
  margin-bottom: calc(24 * var(--os-px));
}

.regulint-success-header h1 {
  font-size: calc(24 * var(--os-px));
  font-weight: 700;
  color: #111827;
  margin: 0;
}

/* ==========================================================================
   Order Summary
   ========================================================================== */

.regulint-order-summary {
  background-color: #f9fafb;
  border-radius: calc(8 * var(--os-px));
  padding: calc(20 * var(--os-px));
  margin-bottom: calc(24 * var(--os-px));
}

.regulint-order-summary h2 {
  font-size: calc(16 * var(--os-px));
  font-weight: 600;
  color: #374151;
  margin: 0 0 calc(16 * var(--os-px)) 0;
}

/* Order Items */
.regulint-order-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(8 * var(--os-px)) 0;
}

.regulint-order-item-border {
  border-bottom: calc(1 * var(--os-px)) solid #e5e7eb;
}

.regulint-order-item-name {
  color: #4b5563;
  font-size: calc(15 * var(--os-px));
}

.regulint-no-items {
  color: #6b7280;
  font-size: calc(15 * var(--os-px));
  margin: 0;
}

/* Order Total */
.regulint-order-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: calc(16 * var(--os-px));
  padding-top: calc(16 * var(--os-px));
  border-top: calc(2 * var(--os-px)) solid #e5e7eb;
  font-weight: 600;
}

.regulint-order-total span:first-child {
  color: #111827;
}

.regulint-total-amount {
  color: #111827;
  font-size: calc(18 * var(--os-px));
}

/* ==========================================================================
   Email Status Section - Simplified 2-State Display
   ========================================================================== */

.regulint-email-section {
  margin-bottom: calc(24 * var(--os-px));
}

/* Shared status box styles */
.regulint-status-pending,
.regulint-status-success,
.regulint-status-error {
  display: flex;
  align-items: flex-start;
  gap: calc(16 * var(--os-px));
  padding: calc(20 * var(--os-px));
  border-radius: calc(8 * var(--os-px));
}

/* Pending state */
.regulint-status-pending {
  background-color: #fef3c7;
  border: calc(1 * var(--os-px)) solid #f59e0b;
}

.regulint-status-icon-pending {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(24 * var(--os-px));
  height: calc(24 * var(--os-px));
}

/* Success state */
.regulint-status-success {
  background-color: #dcfce7;
  border: calc(1 * var(--os-px)) solid #16a34a;
}

.regulint-status-icon-success {
  flex-shrink: 0;
  width: calc(24 * var(--os-px));
  height: calc(24 * var(--os-px));
  color: #16a34a;
}

.regulint-status-icon-success svg {
  width: 100%;
  height: 100%;
}

/* Error state */
.regulint-status-error {
  background-color: #fef2f2;
  border: calc(1 * var(--os-px)) solid #dc2626;
}

.regulint-status-icon-error {
  flex-shrink: 0;
  width: calc(24 * var(--os-px));
  height: calc(24 * var(--os-px));
  color: #dc2626;
}

.regulint-status-icon-error svg {
  width: 100%;
  height: 100%;
}

/* Status content */
.regulint-status-content {
  flex: 1;
}

.regulint-status-title {
  font-size: calc(16 * var(--os-px));
  font-weight: 600;
  margin: 0 0 calc(8 * var(--os-px)) 0;
  color: #111827;
}

.regulint-status-pending .regulint-status-title {
  color: #92400e;
}

.regulint-status-success .regulint-status-title {
  color: #166534;
}

.regulint-status-error .regulint-status-title {
  color: #dc2626;
}

.regulint-status-hint {
  font-size: calc(14 * var(--os-px));
  color: #92400e;
  margin: 0;
  line-height: 1.5;
}

.regulint-status-message {
  font-size: calc(14 * var(--os-px));
  color: #166534;
  margin: 0 0 calc(8 * var(--os-px)) 0;
  line-height: 1.5;
}

.regulint-status-message strong {
  font-weight: 600;
}

.regulint-error-text {
  color: #dc2626;
}

/* ==========================================================================
   Action Buttons
   ========================================================================== */

.regulint-action-buttons {
  display: flex;
  flex-direction: column;
  gap: calc(12 * var(--os-px));
}

.regulint-dashboard-btn {
  background-color: #10b981;
}

.regulint-dashboard-btn:hover {
  background-color: #059669;
  filter: none;
}

.regulint-home-btn {
  background-color: #6b7280;
}

.regulint-home-btn:hover {
  background-color: #4b5563;
  filter: none;
}

/* ==========================================================================
   Button
   ========================================================================== */

.regulint-success-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(8 * var(--os-px));
  width: 100%;
  padding: calc(14 * var(--os-px)) calc(24 * var(--os-px));
  background-color: #3b82f6;
  color: #fff;
  border: none;
  border-radius: calc(8 * var(--os-px));
  font-size: calc(16 * var(--os-px));
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.2s;
}

.regulint-success-btn:hover {
  filter: brightness(1.1);
  color: #fff;
  text-decoration: none;
}

.regulint-success-btn svg {
  width: calc(18 * var(--os-px));
  height: calc(18 * var(--os-px));
}

/* ==========================================================================
   Error State
   ========================================================================== */

.regulint-success-error .regulint-success-card {
  text-align: center;
}

.regulint-error-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(64 * var(--os-px));
  height: calc(64 * var(--os-px));
  margin: 0 auto calc(24 * var(--os-px));
  background-color: #fef2f2;
  border-radius: 50%;
  color: #dc2626;
}

.regulint-error-icon svg {
  width: calc(32 * var(--os-px));
  height: calc(32 * var(--os-px));
}

.regulint-success-error h1 {
  font-size: calc(20 * var(--os-px));
  font-weight: 600;
  color: #111827;
  margin: 0 0 calc(8 * var(--os-px)) 0;
}

.regulint-success-error p {
  color: #6b7280;
  margin: 0 0 calc(24 * var(--os-px)) 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 640px) {
  .regulint-order-success-page {
    padding: calc(16 * var(--os-px));
    min-height: calc(100vh - calc(150 * var(--os-px)));
  }

  .regulint-success-card {
    padding: calc(24 * var(--os-px));
  }

  .regulint-success-header h1 {
    font-size: calc(20 * var(--os-px));
  }

  .regulint-next-steps h2 {
    font-size: calc(16 * var(--os-px));
  }
}

/* ==========================================================================
   Email Delivery Status
   ========================================================================== */

.regulint-email-delivery-status {
  margin-top: calc(12 * var(--os-px));
  padding: calc(12 * var(--os-px)) calc(16 * var(--os-px));
  background-color: #fef3c7;
  border-radius: calc(6 * var(--os-px));
  border: calc(1 * var(--os-px)) solid #f59e0b;
}

.regulint-delivery-pending {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(8 * var(--os-px));
  text-align: center;
}

.regulint-delivery-pending p {
  margin: 0;
  color: #92400e;
  font-size: calc(14 * var(--os-px));
  line-height: 1.5;
}

.regulint-mini-spinner {
  width: calc(20 * var(--os-px));
  height: calc(20 * var(--os-px));
  border: calc(2 * var(--os-px)) solid #f59e0b;
  border-top-color: transparent;
  border-radius: 50%;
  animation: regulint-spin 1s linear infinite;
}

.regulint-delivery-hint {
  font-size: calc(13 * var(--os-px)) !important;
  font-style: italic;
  opacity: 0.9;
}

.regulint-delivery-error {
  text-align: center;
}

.regulint-delivery-error p {
  margin: 0;
  font-size: calc(14 * var(--os-px));
}

.regulint-delivery-success {
  display: flex;
  align-items: center;
  gap: calc(8 * var(--os-px));
  color: #166534;
  background-color: #dcfce7;
  border-color: #16a34a;
}

.regulint-delivery-success p {
  margin: 0;
  color: #166534;
  font-size: calc(14 * var(--os-px));
}

.regulint-delivery-success svg {
  width: calc(20 * var(--os-px));
  height: calc(20 * var(--os-px));
  flex-shrink: 0;
}

/* Spam Folder Hint */
.regulint-spam-hint {
  margin-top: calc(4 * var(--os-px)) !important;
  font-size: calc(13 * var(--os-px)) !important;
  color: #4b5563 !important;
  font-style: italic;
}

/* ==========================================================================
   Email Correction Form
   ========================================================================== */

.regulint-email-correction {
  margin-top: calc(16 * var(--os-px));
  padding-top: calc(16 * var(--os-px));
  border-top: calc(1 * var(--os-px)) solid rgba(220, 38, 38, 0.2);
}

.regulint-correction-hint {
  margin: 0 0 calc(12 * var(--os-px)) 0 !important;
  font-size: calc(14 * var(--os-px)) !important;
  color: #374151 !important;
}

.regulint-correction-form {
  display: flex;
  gap: calc(8 * var(--os-px));
  margin-bottom: calc(8 * var(--os-px));
}

@media (max-width: 480px) {
  .regulint-correction-form {
    flex-direction: column;
  }
}

.regulint-email-input {
  flex: 1;
  padding: calc(10 * var(--os-px)) calc(14 * var(--os-px));
  font-size: calc(14 * var(--os-px));
  border: calc(1 * var(--os-px)) solid #d1d5db;
  border-radius: calc(6 * var(--os-px));
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.regulint-email-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 calc(3 * var(--os-px)) rgba(59, 130, 246, 0.15);
}

.regulint-email-input::placeholder {
  color: #9ca3af;
}

.regulint-resend-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: calc(6 * var(--os-px));
  padding: calc(10 * var(--os-px)) calc(18 * var(--os-px));
  background-color: #3b82f6;
  color: #fff;
  border: none;
  border-radius: calc(6 * var(--os-px));
  font-size: calc(14 * var(--os-px));
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, opacity 0.2s;
  white-space: nowrap;
}

.regulint-resend-btn:hover:not(:disabled) {
  background-color: #2563eb;
}

.regulint-resend-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.regulint-resend-loading {
  display: inline-flex;
  align-items: center;
  gap: calc(6 * var(--os-px));
}

.regulint-btn-spinner {
  width: calc(14 * var(--os-px));
  height: calc(14 * var(--os-px));
  border: calc(2 * var(--os-px)) solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: regulint-spin 0.8s linear infinite;
}

/* "My email is correct" retry button */
.regulint-email-correct-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: calc(6 * var(--os-px));
  width: 100%;
  margin: calc(12 * var(--os-px)) 0;
  padding: calc(12 * var(--os-px)) calc(18 * var(--os-px));
  background-color: #10b981;
  color: #fff;
  border: none;
  border-radius: calc(6 * var(--os-px));
  font-size: calc(14 * var(--os-px));
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, opacity 0.2s;
}

.regulint-email-correct-btn:hover:not(:disabled) {
  background-color: #059669;
}

.regulint-email-correct-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.regulint-correct-loading {
  display: inline-flex;
  align-items: center;
  gap: calc(6 * var(--os-px));
}

/* Status Messages */
.regulint-resend-status {
  margin: calc(8 * var(--os-px)) 0 0 0 !important;
  padding: calc(8 * var(--os-px)) calc(12 * var(--os-px));
  border-radius: calc(4 * var(--os-px));
  font-size: calc(13 * var(--os-px)) !important;
}

.regulint-resend-error {
  background-color: #fef2f2;
  color: #dc2626 !important;
  border: calc(1 * var(--os-px)) solid #fecaca;
}

.regulint-resend-success {
  background-color: #f0fdf4;
  color: #166534 !important;
  border: calc(1 * var(--os-px)) solid #bbf7d0;
}

.regulint-cooldown-text {
  margin: calc(8 * var(--os-px)) 0 0 0 !important;
  font-size: calc(13 * var(--os-px)) !important;
  color: #6b7280 !important;
  font-style: italic;
}

/* Support Hint */
.regulint-support-hint {
  margin: calc(16 * var(--os-px)) 0 0 0 !important;
  padding-top: calc(12 * var(--os-px));
  border-top: calc(1 * var(--os-px)) solid rgba(220, 38, 38, 0.2);
  font-size: calc(13 * var(--os-px)) !important;
  color: #6b7280 !important;
}

.regulint-support-hint a {
  color: #3b82f6;
  text-decoration: underline;
}

.regulint-support-hint a:hover {
  color: #2563eb;
}

/* ==========================================================================
   Bank Transfer State
   ========================================================================== */

.regulint-status-bank-transfer {
  display: flex;
  align-items: flex-start;
  gap: calc(16 * var(--os-px));
  padding: calc(20 * var(--os-px));
  border-radius: calc(8 * var(--os-px));
  background-color: #eff6ff;
  border: calc(1 * var(--os-px)) solid #3b82f6;
}

.regulint-status-icon-bank {
  flex-shrink: 0;
  width: calc(24 * var(--os-px));
  height: calc(24 * var(--os-px));
  color: #3b82f6;
}

.regulint-status-icon-bank svg {
  width: 100%;
  height: 100%;
}

.regulint-status-bank-transfer .regulint-status-title {
  color: #1e40af;
}

.regulint-bank-intro {
  font-size: calc(14 * var(--os-px));
  color: #1e40af;
  margin: 0 0 calc(16 * var(--os-px)) 0;
  line-height: 1.5;
}

/* Bank Details Table */
.regulint-bank-details {
  background-color: #fff;
  border-radius: calc(6 * var(--os-px));
  padding: calc(16 * var(--os-px));
  margin-bottom: calc(16 * var(--os-px));
  border: calc(1 * var(--os-px)) solid #dbeafe;
}

.regulint-bank-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(8 * var(--os-px)) 0;
  border-bottom: calc(1 * var(--os-px)) solid #e5e7eb;
}

.regulint-bank-row:last-child {
  border-bottom: none;
}

.regulint-bank-label {
  font-size: calc(14 * var(--os-px));
  color: #6b7280;
  font-weight: 500;
}

.regulint-bank-value {
  font-size: calc(14 * var(--os-px));
  color: #111827;
  font-weight: 600;
  text-align: right;
  word-break: break-all;
}

.regulint-bank-reference {
  color: #111827;
}

.regulint-bank-row-amount {
  padding-top: calc(12 * var(--os-px));
  margin-top: calc(4 * var(--os-px));
  border-top: calc(2 * var(--os-px)) solid #e5e7eb;
  border-bottom: none;
}

/* Remove border-bottom from row before amount row */
.regulint-bank-row-last {
  border-bottom: none;
}

.regulint-bank-amount-value {
  font-size: calc(18 * var(--os-px));
  color: #111827;
  font-weight: 700;
}

/* Bank Notice */
.regulint-bank-notice {
  background-color: #fff;
  border: calc(1 * var(--os-px)) solid #dbeafe;
  border-radius: calc(6 * var(--os-px));
  padding: calc(12 * var(--os-px));
}

.regulint-bank-notice p {
  font-size: calc(13 * var(--os-px));
  color: #374151;
  margin: 0;
  line-height: 1.5;
}

.regulint-bank-notice p + p {
  margin-top: calc(8 * var(--os-px));
}

.regulint-bank-notice strong {
  font-weight: 700;
}

/* Info Notice (second card) */
.regulint-bank-notice-info {
  margin-top: calc(12 * var(--os-px));
  background-color: #fff;
  border-color: #93c5fd;
}

.regulint-bank-notice-info p {
  color: #374151;
}

.regulint-next-steps-title {
  display: flex;
  align-items: center;
  gap: calc(8 * var(--os-px));
  margin-bottom: calc(12 * var(--os-px)) !important;
}

.regulint-next-steps-title svg {
  flex-shrink: 0;
  color: #10b981;
}

.regulint-bank-notice-info .regulint-support-link {
  color: #1e40af;
  font-weight: 600;
}

.regulint-support-link {
  color: #1e40af;
  text-decoration: none;
  font-weight: 600;
}

.regulint-support-link:hover {
  text-decoration: underline;
}

/* Responsive adjustments for bank transfer */
@media (max-width: 480px) {
  .regulint-bank-row {
    flex-direction: column;
    align-items: flex-start;
    gap: calc(4 * var(--os-px));
  }

  .regulint-bank-value {
    text-align: left;
  }

  .regulint-bank-row-highlight {
    margin: 0 calc(-8 * var(--os-px));
    padding: calc(8 * var(--os-px));
  }
}
