/* Portal Styles - Single unified stylesheet */
/* Colors are injected via CSS variables from the config */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
  --primary-color: #1f1e3e;
  --secondary-color: #2d2b52;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(
      ellipse at center,
      rgba(255, 255, 255, 0.12) 0%,
      transparent 60%
    ),
    linear-gradient(
      135deg,
      var(--primary-color) 0%,
      var(--secondary-color) 100%
    );
  background-attachment: fixed;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Floating background orbs */
.bg-shapes {
  position: fixed;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.6;
  animation: float 20s infinite ease-in-out;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--primary-color) 80%, #9333ea 20%) 0%,
    transparent 70%
  );
  top: -15%;
  left: -15%;
  animation-delay: 0s;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--secondary-color) 70%, #3b82f6 30%) 0%,
    transparent 70%
  );
  bottom: -15%;
  right: -15%;
  animation-delay: -5s;
}

.orb-3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--primary-color) 60%, #ec4899 40%) 0%,
    transparent 70%
  );
  top: 35%;
  right: 15%;
  animation-delay: -10s;
}

.orb-4 {
  width: 300px;
  height: 300px;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--secondary-color) 50%, #a855f7 50%) 0%,
    transparent 70%
  );
  bottom: 25%;
  left: 25%;
  animation-delay: -15s;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(30px, -50px) scale(1.1);
  }
  50% {
    transform: translate(-20px, -30px) scale(0.9);
  }
  75% {
    transform: translate(-40px, 40px) scale(1.05);
  }
}

.portal-wrapper {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  position: relative;
  z-index: 1;
}

/* Mobile: full screen card */
@media (max-width: 480px) {
  .portal-wrapper {
    padding: 0;
    align-items: stretch;
  }
}

.portal-container {
  width: 100%;
  max-width: 400px;
  background-color: #ffffff;
  border-radius: 24px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Mobile: full screen card */
@media (max-width: 480px) {
  .portal-container {
    max-width: 100%;
    min-height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }
}

.portal-header {
  padding: 32px 24px 20px;
  text-align: center;
  background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
}

.portal-logo {
  max-width: 200px;
  max-height: 120px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.portal-content {
  flex: 1;
  padding: 24px 28px 32px;
}

/* Welcome section with icon */
.welcome-section {
  text-align: center;
  margin-bottom: 28px;
}

.welcome-section .wifi-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.welcome-section h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0 0 6px;
}

.welcome-section .subtitle {
  font-size: 0.95rem;
  color: #6b7280;
  margin: 0;
}

.portal-content h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0 0 6px;
  text-align: center;
}

.portal-content .subtitle {
  font-size: 0.9rem;
  color: #6b7280;
  text-align: center;
  margin-bottom: 24px;
}

/* Form styles */
.portal-form {
  width: 100%;
}

.portal-form .form-group {
  margin-bottom: 20px;
}

.portal-form label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 8px;
}

.portal-form .form-group > label {
  display: block;
}

.portal-form .checkbox-label {
  display: flex !important;
}

.portal-form .form-control {
  width: 100%;
  padding: 14px 16px;
  font-size: 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  background-color: #f9fafb;
  transition: all 0.2s ease;
}

.portal-form .form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(31, 30, 62, 0.1);
}

.portal-form .form-control::placeholder {
  color: #9ca3af;
}

/* Code input wrapper and styling */
.code-input-wrapper {
  position: relative;
}

.portal-form .code-input {
  text-align: center;
  font-size: 2rem;
  letter-spacing: 0.5em;
  font-weight: 600;
  padding: 18px 16px;
  padding-left: calc(16px + 0.25em);
  font-family: "SF Mono", Monaco, "Courier New", monospace;
}

.help-text {
  font-size: 0.8rem;
  color: #9ca3af;
  text-align: center;
  margin-top: 10px;
}

/* Modern button styles */
.btn-portal {
  width: 100%;
  padding: 16px 24px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-portal:active {
  transform: scale(0.98);
}

.btn-portal-primary {
  display: block;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  color: #fff;
  border: 1px solid transparent;
  box-shadow: 0 4px 14px rgba(31, 30, 62, 0.4);
  text-align: center;
  text-decoration: none;
}

.btn-portal-primary:hover {
  box-shadow: 0 6px 20px rgba(31, 30, 62, 0.5);
  transform: translateY(-1px);
}

.btn-portal-secondary {
  background: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-portal-outline {
  background: transparent;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-portal-outline:hover {
  background: rgba(0, 0, 0, 0.03);
}

/* Button group with spacing */
.button-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

/* Marketing question text */
.marketing-question {
  margin-top: 8px;
  margin-bottom: 4px;
}

.marketing-question-text {
  font-size: 0.875rem;
  color: #4b5563;
  line-height: 1.5;
  margin: 0;
  text-align: center;
}

/* Checkbox styling */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 400;
  cursor: pointer;
  font-size: 0.875rem;
  color: #4b5563;
  line-height: 1.5;
  padding: 4px 0;
}

.checkbox-label input[type="checkbox"] {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  accent-color: var(--primary-color);
  cursor: pointer;
}

.checkbox-label span {
  flex: 1;
}

.checkbox-label a {
  color: var(--primary-color);
  text-decoration: underline;
}

/* Error messages */
.text-danger {
  display: none;
}

.alert-danger {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 0.875rem;
}

/* Success Card */
.success-card {
  text-align: center;
}

.success-card .success-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 1.5rem;
}

.success-card .success-icon.already-connected-icon {
  width: 70px;
  height: 70px;
  padding: 12px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
}

.success-card .success-icon.already-connected-icon svg {
  width: 100%;
  height: 100%;
  stroke: white;
}

.success-card .checkmark {
  width: 60px;
  height: 60px;
  display: block;
  stroke-width: 3;
  stroke: var(--primary-color);
  stroke-miterlimit: 10;
}

.success-card .checkmark-circle {
  stroke: var(--primary-color);
  fill: none;
}

.success-card .checkmark-check {
  stroke: var(--primary-color);
  fill: none;
}

.success-card h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.75rem;
}

.success-card .subtitle {
  font-size: 1rem;
  color: #6b7280;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.success-card .info-grid {
  margin-bottom: 1.5rem;
}

.success-card .info-item {
  background: #f3f4f6;
  padding: 1rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.success-card .info-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.success-card .info-icon svg {
  width: 20px;
  height: 20px;
  stroke: white;
  fill: none;
  stroke-width: 2;
}

.success-card .info-text {
  text-align: left;
  flex: 1;
}

.success-card .info-label {
  font-size: 0.75rem;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.success-card .info-value {
  font-size: 0.95rem;
  color: var(--primary-color);
  font-weight: 600;
  margin-top: 0.25rem;
}

.success-card .venue-image {
  width: 100%;
  height: 160px;
  background-size: cover;
  background-position: center;
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.success-card .footer-text {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: #9ca3af;
}

/* Footer */
.portal-footer {
  padding: 16px 24px;
  text-align: center;
  background-color: #f9fafb;
  border-top: 1px solid #e5e7eb;
}

.portal-links a {
  color: #4b5563;
  text-decoration: none;
  font-size: 0.75rem;
}

.portal-links a:hover {
  color: var(--primary-color);
}

.portal-links .separator {
  margin: 0 10px;
  color: #d1d5db;
}

.portal-copyright {
  font-size: 0.7rem;
  color: #9ca3af;
  margin-top: 8px;
}

/* Required field indicator */
.required-indicator {
  color: #dc2626;
  margin-left: 4px;
}

/* Enhanced error message styling */
.field-error {
  display: flex;
  align-items: start;
  gap: 8px;
  margin-top: 8px;
  padding: 10px 12px;
  background-color: #fef2f2;
  border-left: 3px solid #dc2626;
  border-radius: 8px;
  font-size: 0.8125rem;
  color: #991b1b;
  line-height: 1.4;
}

.field-error-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 1px;
}

.field-error-icon svg {
  width: 100%;
  height: 100%;
  fill: #dc2626;
}

.field-error-text {
  flex: 1;
}

/* Input error state */
.form-control.input-error {
  border-color: #dc2626;
  background-color: #fef2f2;
}

.form-control.input-error:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

/* Error Card (full page error) */
.error-card {
  text-align: center;
}

.error-card .error-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-card .error-icon svg {
  width: 40px;
  height: 40px;
  stroke: white;
}

.error-card h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #dc2626;
  margin-bottom: 0.75rem;
}

.error-card .subtitle {
  font-size: 1rem;
  color: #6b7280;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.error-card .error-message {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.error-card .error-message p {
  color: #991b1b;
  margin: 0;
  font-size: 0.95rem;
}

.error-card .footer-text {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: #9ca3af;
}

/* Inline form error alert (for server-side validation errors) */
.form-error-alert {
  display: flex;
  align-items: start;
  gap: 12px;
  padding: 14px 16px;
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  margin-bottom: 20px;
}

.form-error-alert .error-alert-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

.form-error-alert .error-alert-icon svg {
  width: 100%;
  height: 100%;
  fill: #dc2626;
}

.form-error-alert .error-alert-text {
  flex: 1;
  color: #991b1b;
  font-size: 0.9rem;
  line-height: 1.5;
}
