/* ============================================================
   Benevolent Loves Portal
   Faithful port of the React/Tailwind landing page.
   Colors and shapes mirror the original 1:1.
   ============================================================ */

:root {
    --midnight-indigo: #1E1B2E;
    --electric-magenta: #E847AE;
    --cyan-blue: #3DE3F1;
    --soft-lavender: #9E8AFF;
    --mist-gray: #E9E9EB;
    --onyx: #141418;

    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--onyx);
    color: var(--mist-gray);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    margin: 0;
}

a { color: inherit; text-decoration: none; }

/* ============================================================
   Page shell + background gradient
   Mirrors:  bg-gradient-to-br from-onyx via-midnight-indigo to-onyx
   ============================================================ */
.page {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background: linear-gradient(135deg, var(--onyx) 0%, var(--midnight-indigo) 50%, var(--onyx) 100%);
    padding: 4rem 1rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* The subtle animated pulse wash */
.bg-pulse {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
        rgba(232, 71, 174, 0.05) 0%,
        rgba(61, 227, 241, 0.05) 50%,
        rgba(158, 138, 255, 0.05) 100%);
    animation: pulse 4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* The big magenta glow that sits behind everything at the page center */
.page-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24rem;               /* w-96 */
    height: 24rem;              /* h-96 */
    transform: translate(-50%, -50%);
    background: rgba(232, 71, 174, 0.2);   /* bg-electric-magenta/20 */
    border-radius: 50%;
    filter: blur(64px);          /* blur-3xl */
    pointer-events: none;
    z-index: 0;
}

/* Everything above bg-pulse / page-glow */
.hero,
.portal-grid,
.contact,
.footer { position: relative; z-index: 1; }

/* ============================================================
   Auth strip — floats in the top-right of the page, taking no
   vertical space so the hero stays at the top of the viewport.
   ============================================================ */
.auth-strip {
    position: absolute;
    top: 1.25rem;
    right: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 2;
}

.auth-greeting {
    font-family: var(--font-body);
    color: rgba(233, 233, 235, 0.7);
    font-size: 0.9rem;
}

.auth-greeting strong {
    color: var(--mist-gray);
    font-weight: 500;
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    border: 2px solid rgba(233, 233, 235, 0.2);
    background: rgba(30, 27, 46, 0.3);
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

.auth-btn:hover {
    border-color: var(--cyan-blue);
    box-shadow: 0 0 20px rgba(61, 227, 241, 0.25);
    transform: translateY(-1px);
}

.auth-btn-login:hover { border-color: var(--cyan-blue); }
.auth-btn-logout:hover { border-color: var(--electric-magenta); box-shadow: 0 0 20px rgba(232, 71, 174, 0.25); }

/* ============================================================
   Hero: wordmark + tagline
   ============================================================ */
.hero {
    text-align: center;
    margin-top: 3rem;
    margin-bottom: 4rem;
    width: 100%;
}

.wordmark {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    line-height: 1.1;
    background: linear-gradient(90deg,
        var(--electric-magenta) 0%,
        var(--soft-lavender) 50%,
        var(--cyan-blue) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: pulse 4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    padding: 0 0.5rem;
    margin: 0;
}

.tagline {
    margin-top: 1.5rem;
    font-family: var(--font-body);
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: rgba(233, 233, 235, 0.8);
}

/* ============================================================
   Portal grid + cards
   Mirrors the React PortalCard including:
     - rounded-2xl, p-8, backdrop-blur, 2px border
     - hover: border -> accent color, bg tint, glow shadow
     - 3D perspective tilt on mousemove (up to 8deg)
     - staggered fade-in by index
   ============================================================ */
.portal-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    width: 100%;
    max-width: 72rem;
}

@media (min-width: 768px) {
    .portal-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .portal-grid { grid-template-columns: repeat(3, 1fr); }
}

.portal-card {
    position: relative;
    padding: 2rem;
    border-radius: 1rem;
    backdrop-filter: blur(4px);
    border: 2px solid rgba(233, 233, 235, 0.2);
    background: rgba(30, 27, 46, 0.3);
    transform: perspective(1000px) rotateX(0deg) rotateY(0deg) scale(1);
    /* transition-all duration-300 ease-out — tilt glides smoothly */
    transition: all 0.3s ease-out;
    will-change: transform;

    opacity: 0;
    animation: fade-in 0.5s ease-out forwards;
    animation-delay: var(--delay, 0ms);
    cursor: pointer;
}

.portal-card:hover {
    border-color: var(--accent);
    background-color: color-mix(in srgb, var(--accent) 6%, transparent);
    box-shadow: 0 0 30px color-mix(in srgb, var(--accent) 30%, transparent);
}

/* Fallback for browsers without color-mix */
@supports not (background: color-mix(in srgb, red, blue)) {
    .portal-card:hover {
        background-color: rgba(30, 27, 46, 0.5);
    }
}

.portal-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    font-family: var(--font-body);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 999px;
    opacity: 0.4;
    background: color-mix(in srgb, var(--accent) 15%, transparent);
    color: var(--accent);
    transition: opacity 0.3s ease;
}

.portal-card:hover .portal-badge { opacity: 0.75; }

.portal-glow {
    position: absolute;
    inset: 0;
    border-radius: 1rem;
    opacity: 0;
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--accent) 8%, transparent),
        transparent);
    filter: blur(24px);
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.portal-card:hover .portal-glow { opacity: 1; }

.portal-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.portal-icon {
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
    font-size: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(233, 233, 235, 0.6);
    transition: all 0.3s ease-out;
}

.portal-card:hover .portal-icon { color: var(--accent); }
.portal-card:hover .portal-arrow { color: var(--accent); }

/* Inlined SVGs — fill/stroke use currentColor so they pick up .portal-icon's color */
.portal-icon svg {
    width: 3rem;
    height: 3rem;
    display: block;
    color: inherit;
}

.portal-icon-glyph {
    font-size: 3rem;
    line-height: 1;
    color: inherit;
}

.portal-text { flex: 1; min-width: 0; }

.portal-name {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--mist-gray);
    margin: 0 0 2px;
    transition: color 0.3s ease;
}

.portal-card:hover .portal-name { color: #ffffff; }

.portal-desc {
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: rgba(233, 233, 235, 0.6);
    margin: 0;
    transition: color 0.3s ease;
}

.portal-card:hover .portal-desc { color: rgba(233, 233, 235, 0.8); }

.portal-arrow {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    color: rgba(233, 233, 235, 0.4);
    transition: all 0.3s ease-out;
}

.portal-card:hover .portal-arrow {
    transform: translateX(4px);
    color: var(--accent);
}

/* ============================================================
   Contact form
   ============================================================ */
.contact {
    margin-top: 6rem;
    width: 100%;
    max-width: 42rem;
    opacity: 0;
    animation: fade-in 0.5s ease-out forwards;
    animation-delay: var(--contact-delay, 0ms);
}

.contact-card {
    position: relative;
    padding: 2rem;
    border-radius: 1rem;
    backdrop-filter: blur(4px);
    border: 2px solid rgba(233, 233, 235, 0.2);
    background: rgba(30, 27, 46, 0.3);
}

.contact-glow {
    position: absolute;
    inset: 0;
    border-radius: 1rem;
    background: linear-gradient(135deg,
        rgba(232, 71, 174, 0.05),
        rgba(61, 227, 241, 0.05),
        rgba(158, 138, 255, 0.05));
    filter: blur(24px);
    pointer-events: none;
}

.contact-inner { position: relative; }

.contact-title {
    font-family: var(--font-heading);
    font-size: 1.875rem;
    font-weight: 600;
    text-align: center;
    margin: 0 0 0.5rem;
    background: linear-gradient(90deg, var(--electric-magenta), var(--cyan-blue));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.contact-sub {
    text-align: center;
    font-family: var(--font-body);
    color: rgba(233, 233, 235, 0.6);
    margin: 0 0 2rem;
}

.contact-form { display: flex; flex-direction: column; gap: 1.5rem; }

.field { display: flex; flex-direction: column; gap: 0.5rem; }

.field label {
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: rgba(233, 233, 235, 0.8);
}

.field input,
.field textarea {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    background: rgba(20, 20, 24, 0.5);
    border: 2px solid rgba(233, 233, 235, 0.2);
    color: var(--mist-gray);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    resize: none;
}

.field input::placeholder,
.field textarea::placeholder {
    color: rgba(233, 233, 235, 0.35);
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--cyan-blue);
    box-shadow: 0 0 0 3px rgba(61, 227, 241, 0.2);
}

.contact-submit {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    color: #ffffff;
    cursor: pointer;
    background: linear-gradient(90deg, var(--electric-magenta), var(--cyan-blue));
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
}

.contact-submit:hover:not(:disabled) {
    transform: scale(1.03);
    box-shadow: 0 10px 30px rgba(61, 227, 241, 0.3);
}

.contact-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-status {
    text-align: center;
    font-family: var(--font-body);
    font-size: 0.875rem;
    margin: 0;
    min-height: 1.25rem;
}

.form-status.success { color: var(--cyan-blue); }
.form-status.error   { color: var(--electric-magenta); }

/* ============================================================
   Footer
   ============================================================ */
.footer {
    margin-top: 4rem;
    margin-bottom: 2rem;
    text-align: center;
}

.footer p {
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: rgba(233, 233, 235, 0.4);
    margin: 0;
}

/* ============================================================
   Animations
   ============================================================ */
@keyframes fade-in {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
