/* Payment Portal Styles - Modern Re-design */

:root {
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.1);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --card-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  line-height: 1.5;
}

.container {
  width: 100%;
  max-width: 520px;
  perspective: 1000px;
}

.payment-portal {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: var(--card-shadow);
  padding: 40px;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 8px;
  text-align: center;
  background: linear-gradient(to right, #fff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 32px;
}

h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section {
  margin-bottom: 32px;
}

.section.hidden {
  display: none;
}

/* Form Styles */
.form-group {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 14px 16px;
  color: white;
  font-size: 16px;
  transition: all 0.2s ease;
}

.input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
  background: rgba(15, 23, 42, 0.8);
}

.button {
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.button.primary {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.button.primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

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

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Order Card */
.order-card {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 20px;
  margin-top: 16px;
}

.section-actions {
  margin-top: 20px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--glass-border);
}

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

.label {
  color: var(--text-secondary);
  font-size: 14px;
}

.value {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 14px;
}

.status-badge {
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.status-pending { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.status-paid { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.status-failed { background: rgba(239, 68, 68, 0.1); color: var(--error); }

/* Error Message */
.error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
  padding: 12px 16px;
  border-radius: 12px;
  margin-top: 16px;
  font-size: 14px;
  border: 1px solid rgba(239, 68, 68, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
}

.error.hidden {
  display: none;
}

/* Lookup message (when no order param in URL) */
.lookup-message {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.lookup-message code {
  background: rgba(15, 23, 42, 0.6);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 13px;
}

.lookup-message.hidden {
  display: none;
}

/* Lookup loading state */
.lookup-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 14px;
}

.lookup-loading .spinner {
  flex-shrink: 0;
}

.lookup-loading.hidden {
  display: none;
}

/* Stripe Element */
#payment-element {
  margin-bottom: 24px;
  background: rgba(15, 23, 42, 0.3);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
}

/* Success State */
.success-message {
  text-align: center;
  padding: 20px 0;
}

.success-icon-wrapper {
  width: 64px;
  height: 64px;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  color: var(--success);
  font-size: 32px;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.success-message h2 {
  justify-content: center;
  font-size: 24px;
  margin-bottom: 8px;
}

.success-message p {
  color: var(--text-secondary);
  margin-bottom: 32px;
}

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Failed State */
.failed-message {
  text-align: center;
  padding: 20px 0;
}

.failed-icon-wrapper {
  width: 64px;
  height: 64px;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.failed-message h2 {
  justify-content: center;
  font-size: 24px;
  margin-bottom: 8px;
  color: var(--error);
}

.failed-message p {
  color: var(--text-secondary);
  margin-bottom: 32px;
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .payment-portal {
    padding: 24px;
  }
  
  h1 {
    font-size: 24px;
  }
}
