:root {
  --bg: #0b0f16;
  --fg: #e6edf3;
  --muted: #a3b1c2;
  --card: #121826;
  --card-2: #0f1522;
  --acc1: #6aa7ff;
  --acc2: #a36bff;
  --acc3: #3ee7a7;
  --ring: rgba(122, 165, 255, 0.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--fg);
  background: var(--bg);
  font-family: ui-sans-serif, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Animated background */
.bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(1200px 800px at 10% 10%, rgba(106,167,255,0.08), transparent 60%),
              radial-gradient(1000px 700px at 90% 10%, rgba(163,107,255,0.08), transparent 60%),
              radial-gradient(900px 600px at 50% 100%, rgba(62,231,167,0.07), transparent 55%);
  overflow: hidden;
}
.bg::before,
.bg::after {
  content: "";
  position: absolute;
  width: 60vmax; height: 60vmax;
  filter: blur(60px);
  opacity: 0.25;
  background: radial-gradient(circle at 30% 30%, var(--acc1), transparent 60%),
              radial-gradient(circle at 70% 60%, var(--acc2), transparent 60%);
  animation: float1 22s ease-in-out infinite;
}
.bg::after {
  width: 50vmax; height: 50vmax;
  top: 10%; left: 55%;
  opacity: 0.2;
  background: radial-gradient(circle at 60% 40%, var(--acc3), transparent 60%),
              radial-gradient(circle at 30% 70%, var(--acc1), transparent 60%);
  animation: float2 28s ease-in-out infinite;
}
@keyframes float1 { 0%{transform: translate(-10%, -10%) rotate(0)} 50%{transform: translate(10%, 5%) rotate(30deg)} 100%{transform: translate(-10%, -10%) rotate(0)} }
@keyframes float2 { 0%{transform: translate(0, 0) rotate(0)} 50%{transform: translate(-5%, 10%) rotate(-20deg)} 100%{transform: translate(0, 0) rotate(0)} }

/* Topbar */
.topbar {
  position: sticky;
  top: 0; z-index: 10;
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  background: linear-gradient(180deg, rgba(10,14,22,0.8), rgba(10,14,22,0.5));
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}
.topbar .brand {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
}
.topbar .home {
  color: var(--fg);
  text-decoration: none;
  background: linear-gradient(135deg, var(--acc1), var(--acc2));
  color: #0b0f16;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(106,167,255,0.25);
  transition: transform .15s ease, box-shadow .15s ease;
}
.topbar .home:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(106,167,255,0.35); }
.topbar .title { color: var(--muted); font-weight: 600; letter-spacing: 0.3px; }

/* Search */
.search-container {
  max-width: 1200px;
  margin: 20px auto 0;
  padding: 0 16px;
  display: flex;
  justify-content: center;
}
.search-bar {
  width: 100%;
  max-width: 600px;
  padding: 12px 18px;
  font-size: 15px;
  color: var(--fg);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.02));
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}
.search-bar::placeholder {
  color: var(--muted);
  opacity: 0.6;
}
.search-bar:focus {
  border-color: var(--acc1);
  box-shadow: 0 0 0 3px var(--ring);
}

/* Layout */
.content { max-width: 1200px; margin: 22px auto; padding: 0 16px 40px; }
.status { display: none; color: var(--muted); margin: 16px 4px; }
.status.show { display: block; }

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

/* Card */
.card {
  text-decoration: none;
  color: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  transition: transform .15s ease, box-shadow .15s ease, border-color .2s ease;
}
.card::before {
  content: "";
  position: absolute; inset: -1px;
  border-radius: inherit;
  background: radial-gradient(600px 120px at var(--mx, 50%) 0%, rgba(122,165,255,0.2), transparent 50%);
  opacity: 0; transition: opacity .2s ease;
  pointer-events: none;
}
.card:hover { transform: translateY(-2px); border-color: rgba(122, 165, 255, 0.35); box-shadow: 0 16px 40px rgba(0,0,0,0.3); }
.card:hover::before { opacity: 1; }
.card .inner { padding: 16px; display: grid; justify-items: center; gap: 12px; }
.card .icon { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; background: var(--card-2); }
.card .icon.placeholder { display: grid; place-items: center; font-size: 34px; }
.card .name { text-align: center; color: var(--fg); font-weight: 600; line-height: 1.2; }

/* Warning badge */
.warning-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 18px;
  cursor: help;
  z-index: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  transition: transform .15s ease;
}
.warning-badge:hover {
  transform: scale(1.15);
}

/* Mouse highlight tracking */
.grid { --mx: 50%; }
.grid .card { --mx: 50%; }
.grid .card:hover { --mx: var(--local-mx, 50%); }

@media (max-width: 520px) {
  .topbar .brand { padding: 12px 12px; }
  .content { margin-top: 16px; }
}

/* Request Card Button */
.request-card {
  cursor: pointer;
  position: relative;
  z-index: 0;
}

.request-card::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 17px;
  background: linear-gradient(
    45deg,
    #ff0000,
    #ff7f00,
    #ffff00,
    #00ff00,
    #0000ff,
    #4b0082,
    #9400d3,
    #ff0000
  );
  background-size: 400% 400%;
  opacity: 1;
  z-index: -2;
  animation: rainbow-rotate 3s linear infinite;
  pointer-events: none;
  transition: all 0.3s ease;
  filter: blur(6px);
}

.request-card::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 14px;
  background: #121826;
  z-index: -1;
  pointer-events: none;
}

@keyframes rainbow-rotate {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes rainbow-glow {
  0%, 100% {
    filter: drop-shadow(0 0 8px rgba(255, 0, 0, 0.6))
            drop-shadow(0 0 16px rgba(255, 127, 0, 0.4));
  }
  16% {
    filter: drop-shadow(0 0 8px rgba(255, 127, 0, 0.6))
            drop-shadow(0 0 16px rgba(255, 255, 0, 0.4));
  }
  33% {
    filter: drop-shadow(0 0 8px rgba(255, 255, 0, 0.6))
            drop-shadow(0 0 16px rgba(0, 255, 0, 0.4));
  }
  50% {
    filter: drop-shadow(0 0 8px rgba(0, 255, 0, 0.6))
            drop-shadow(0 0 16px rgba(0, 0, 255, 0.4));
  }
  66% {
    filter: drop-shadow(0 0 8px rgba(0, 0, 255, 0.6))
            drop-shadow(0 0 16px rgba(75, 0, 130, 0.4));
  }
  83% {
    filter: drop-shadow(0 0 8px rgba(75, 0, 130, 0.6))
            drop-shadow(0 0 16px rgba(148, 0, 211, 0.4));
  }
}

.request-card:hover {
  transform: translateY(-4px) scale(1.05);
}

.request-card:hover::before {
  filter: blur(16px);
  opacity: 1;
  inset: -12px;
}

.request-card .icon {
  font-size: 42px;
}

/* Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.closing {
    animation: fadeOut 0.3s ease forwards;
}

.modal-overlay.closing .modal-content {
    animation: slideDown 0.3s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Modal Content */
.modal-content {
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    backdrop-filter: saturate(140%) blur(8px);
    -webkit-backdrop-filter: saturate(140%) blur(8px);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    padding: 30px;
    position: relative;
    animation: slideUp 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

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

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

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    color: var(--muted);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--fg);
}

.modal-content h2 {
    color: var(--fg);
    font-size: 26px;
    margin-bottom: 8px;
    font-weight: 700;
}

.modal-subtitle {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 20px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--fg);
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
}

.required {
    color: #ff4757;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.02));
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 8px;
    font-size: 14px;
    color: var(--fg);
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input[type="text"]::placeholder,
.form-group textarea::placeholder {
    color: var(--muted);
    opacity: 0.6;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--acc1);
    box-shadow: 0 0 0 3px var(--ring);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* reCAPTCHA Style Box */
.recaptcha-box {
    border: 1px solid #d3d3d3;
    border-radius: 3px;
    background: #f9f9f9;
    padding: 0;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
    box-shadow: 0 0 4px rgba(0,0,0,0.08);
    position: relative;
    width: 300px;
    height: 75px;
    box-sizing: border-box;
    padding: 0 12px;
}

.recaptcha-checkbox {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 32px;
    height: 32px;
}

.captcha-checkbox-input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 0;
    height: 0;
}

.captcha-checkbox-label {
    display: block;
    width: 32px;
    height: 32px;
    border: 2px solid #c1c1c1;
    border-radius: 3px;
    background: white;
    cursor: pointer;
    position: relative;
    transition: border-color 0.15s ease;
}

.captcha-checkbox-label:hover {
    border-color: #4285f4;
}

.checkmark {
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(1);
    width: 20px;
    height: 20px;
}

.checkmark::after {
    content: '✓';
    color: #1a73e8;
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
}

.captcha-checkbox-input:checked + .captcha-checkbox-label {
    background: white;
    border-color: #1a73e8;
}

.captcha-checkbox-input:checked + .captcha-checkbox-label .checkmark {
    display: flex;
    align-items: center;
    justify-content: center;
}

.recaptcha-text {
    display: flex;
    align-items: center;
}

.recaptcha-label {
    color: #000;
    font-size: 16px;
    font-weight: 400;
    user-select: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.recaptcha-logo {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    justify-self: end;
}

.recaptcha-badge {
    position: absolute;
    top: 0;
    left: 0;
    width: 32px;
    height: 32px;
    display: none;
    pointer-events: none;
}

.recaptcha-box.verified .recaptcha-badge {
    display: block;
}

.badge-icon {
    width: 100%;
    height: 100%;
}

.badge-checkmark {
    opacity: 1;
}

.recaptcha-logo-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 2px;
}

.recaptcha-logo-icon svg {
    width: 100%;
    height: 100%;
}

.recaptcha-branding {
    text-align: right;
}

.recaptcha-brand {
    color: #555;
    font-size: 10px;
    font-weight: 500;
    display: block;
    line-height: 1.3;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.recaptcha-links {
    font-size: 8px;
    color: #555;
    margin-top: 2px;
    line-height: 1;
}

.recaptcha-links a {
    color: #555;
    text-decoration: none;
}

.recaptcha-links a:hover {
    text-decoration: underline;
}

/* Captcha Popup */
.captcha-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border: 1px solid #d3d3d3;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 10001;
    width: 400px;
    max-width: 90vw;
}

.captcha-popup-header {
    background: #4285f4;
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 4px 4px 0 0;
    font-size: 16px;
    font-weight: 500;
}

.captcha-popup-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.captcha-popup-close:hover {
    opacity: 0.8;
}

.captcha-popup-body {
    padding: 24px;
}

.captcha-instruction {
    color: #333;
    font-size: 14px;
    margin-bottom: 12px;
    font-weight: 500;
}

.captcha-word {
    background: #f5f5f5;
    border: 2px solid #4285f4;
    border-radius: 4px;
    padding: 16px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    color: #1976D2;
    margin-bottom: 16px;
    letter-spacing: 2px;
    text-transform: lowercase;
}

.captcha-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #d3d3d3;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 12px;
    transition: border-color 0.2s ease;
}

.captcha-input:focus {
    outline: none;
    border-color: #4285f4;
}

.captcha-error {
    display: none;
    color: #d93025;
    font-size: 13px;
    margin-bottom: 12px;
    padding: 8px;
    background: #fce8e6;
    border-radius: 4px;
}

.captcha-verify-btn {
    width: 100%;
    padding: 10px;
    background: #4285f4;
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.captcha-verify-btn:hover {
    background: #357ae8;
}

.captcha-verify-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.recaptcha-box.verified {
    border-color: #1a73e8;
    background: #f0f7ff;
}

.recaptcha-box.verified .captcha-checkbox-label {
    display: none;
}

.recaptcha-box.verified .recaptcha-text {
    opacity: 0.7;
}

@media (max-width: 600px) {
    .recaptcha-box {
        width: 100%;
        max-width: 304px;
    }
}

.submit-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.success-message,
.error-message {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 500;
    font-size: 14px;
    display: none;
}

.success-message {
    background: rgba(62, 231, 167, 0.15);
    color: var(--acc3);
    border: 2px solid rgba(62, 231, 167, 0.3);
}

.success-message.celebrating {
    animation: successPulse 0.6s ease;
}

@keyframes successPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 30px rgba(62, 231, 167, 0.6);
    }
    100% {
        transform: scale(1);
    }
}

.error-message {
    background: rgba(255, 71, 87, 0.15);
    color: #ff6b7a;
    border: 2px solid rgba(255, 71, 87, 0.3);
}

/* Confetti Animation */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--acc1);
    animation: confetti-fall 3s ease-out forwards;
    z-index: 10002;
    pointer-events: none;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.confetti:nth-child(2n) {
    background: var(--acc2);
    animation-duration: 3.5s;
}

.confetti:nth-child(3n) {
    background: var(--acc3);
    animation-duration: 2.5s;
}

.confetti:nth-child(4n) {
    width: 8px;
    height: 8px;
}

.confetti:nth-child(5n) {
    width: 12px;
    height: 12px;
}

@media (max-width: 600px) {
    .modal-content {
        padding: 20px;
    }
}
