/**
 * GLOBALUNIDO LOAD PORTAL — DESIGN SYSTEM V1.0
 * Matches globalunido.in aesthetic: Deep Plum + Warm Cream + Neon Orange
 */

/* ============================================================
   CSS VARIABLES — GLOBALUNIDO DESIGN TOKENS
   ============================================================ */
:root {
    --h-plum: 312;
    --s-plum: 38%;
    --l-plum: 16%;
    --c-emerald: #10b981;
    --c-neon-orange: #ff793f;
    --c-gold: #f1c40f;

    --n-base: hsl(var(--h-plum), var(--s-plum), var(--l-plum)); /* #381932 */
    --n-ghost: #FFF3E6;
    --n-pure: #FFF3E6;

    --p-prime: var(--n-base);
    --p-accent: var(--n-base);
    --p-light: hsl(var(--h-plum), var(--s-plum), 22%);

    --bg-main: #FFF3E6;
    --text-main: var(--n-base);

    --f-head: 'Syne', sans-serif;
    --f-main: 'Inter', 'Plus Jakarta Sans', sans-serif;
    --f-wide: 'Space Grotesk', sans-serif;
    --f-code: 'JetBrains Mono', monospace;

    --t-fast: 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    --t-norm: 0.45s cubic-bezier(0.25, 0.8, 0.25, 1);
    --t-slow: 0.9s cubic-bezier(0.25, 0.8, 0.25, 1);

    --glass-w-1: rgba(56, 25, 50, 0.05);
    --glass-border: rgba(56, 25, 50, 0.08);
    --glass-border-dark: rgba(56, 25, 50, 0.15);
    --glass-blur: 16px;

    --sh-sm: 0 1px 2px rgba(56, 25, 50, 0.05);
    --sh-med: 0 4px 6px -1px rgba(56, 25, 50, 0.1), 0 2px 4px -1px rgba(56, 25, 50, 0.06);
    --sh-mac: 0 20px 25px -5px rgba(56, 25, 50, 0.1), 0 10px 10px -5px rgba(56, 25, 50, 0.04);
}

/* ============================================================
   RESET & GLOBAL
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}
body {
    background-color: var(--n-ghost);
    color: var(--n-base);
    font-family: var(--f-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

::selection { background: var(--n-base); color: var(--n-ghost); }
::-webkit-scrollbar { width: 8px; background: var(--n-ghost); }
::-webkit-scrollbar-thumb { background: var(--p-light); border-radius: 10px; border: 2px solid var(--n-ghost); }
::-webkit-scrollbar-thumb:hover { background: var(--n-base); }

/* ============================================================
   ATMOSPHERIC BACKGROUND LAYERS
   ============================================================ */
.grain-texture {
    position: fixed; inset: 0; z-index: -3; pointer-events: none; opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 250 250' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.6' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.vignette-overlay {
    position: fixed; inset: 0; z-index: -4; pointer-events: none;
    background: radial-gradient(circle at center, transparent 0%, rgba(0,0,0,0.02) 100%);
}

/* Floating gradient orbs */
.glow-orb {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: -2;
    filter: blur(80px);
    opacity: 0.4;
    animation: orbFloat 15s ease-in-out infinite;
}
.glow-orb-1 {
    width: 500px; height: 500px;
    top: -10%; right: -5%;
    background: radial-gradient(circle, rgba(255, 121, 63, 0.12) 0%, transparent 70%);
}
.glow-orb-2 {
    width: 400px; height: 400px;
    bottom: -10%; left: -5%;
    background: radial-gradient(circle, rgba(56, 25, 50, 0.08) 0%, transparent 70%);
    animation-delay: -7s;
}
.glow-orb-3 {
    width: 300px; height: 300px;
    top: 40%; left: 50%;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(16, 185, 129, 0.06) 0%, transparent 70%);
    animation-delay: -3s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -20px) scale(1.05); }
    50% { transform: translate(-20px, 30px) scale(0.95); }
    75% { transform: translate(15px, 15px) scale(1.02); }
}

/* ============================================================
   MARQUEE BACKGROUND TEXT
   ============================================================ */
.marquee-bg {
    position: fixed;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
    opacity: 0.025;
}
.marquee-bg span {
    display: inline-block;
    font-family: var(--f-head);
    font-size: clamp(6rem, 15vw, 14rem);
    font-weight: 800;
    color: var(--n-base);
    white-space: nowrap;
    animation: marqueeScroll 25s linear infinite;
    padding-right: 80px;
}
@keyframes marqueeScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ============================================================
   NAVBAR
   ============================================================ */
.portal-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 12px 30px;
    background: rgba(255, 243, 230, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    transition: var(--t-norm);
}
.nav-inner {
    max-width: 1360px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}
.nav-logo-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(56, 25, 50, 0.03);
    border: 1px solid rgba(56, 25, 50, 0.08);
    transition: var(--t-fast);
}
.nav-logo-circle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.nav-brand-text {
    font-family: var(--f-head);
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--n-base);
    letter-spacing: 0.5px;
}
.nav-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 99px;
    background: rgba(56, 25, 50, 0.06);
    border: 1px solid rgba(56, 25, 50, 0.12);
    font-family: var(--f-code);
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--n-base);
}
.nav-badge .pulse-dot {
    width: 6px;
    height: 6px;
    background: var(--c-emerald);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--c-emerald);
    animation: radarPulse 2s infinite;
}
@keyframes radarPulse {
    0% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.3); box-shadow: 0 0 12px var(--c-emerald); }
    100% { opacity: 0.4; transform: scale(1); }
}

/* ============================================================
   MAIN PORTAL CARD
   ============================================================ */
.portal-wrapper {
    width: 100%;
    max-width: 580px;
    padding: 100px 20px 40px;
    position: relative;
    z-index: 2;
}
.portal-card {
    background: rgba(255, 243, 230, 0.65);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 28px;
    border: 1px solid rgba(56, 25, 50, 0.1);
    box-shadow: var(--sh-mac), 0 4px 30px rgba(56, 25, 50, 0.03);
    padding: 45px 40px;
    position: relative;
    overflow: hidden;
    animation: cardReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}
@keyframes cardReveal {
    to { opacity: 1; transform: translateY(0); }
}

/* Card inner gradient accent */
.portal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--n-base), var(--c-neon-orange), var(--c-emerald));
    border-radius: 28px 28px 0 0;
}

/* ============================================================
   CARD HEADER
   ============================================================ */
.card-header {
    text-align: center;
    margin-bottom: 35px;
}
.card-header .hud-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 99px;
    background: rgba(56, 25, 50, 0.06);
    border: 1px solid rgba(56, 25, 50, 0.12);
    color: var(--p-prime);
    font-family: var(--f-code);
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 16px;
    backdrop-filter: blur(5px);
}
.card-header h1 {
    font-family: var(--f-wide);
    font-weight: 800;
    font-size: clamp(1.6rem, 4.5vw, 2.2rem);
    line-height: 1.1;
    color: var(--n-base);
    letter-spacing: -1px;
    margin-bottom: 8px;
}
.card-header h1 .grad-word {
    background: linear-gradient(90deg, var(--n-base), var(--c-neon-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.card-header .subtitle {
    font-size: 0.9rem;
    color: var(--n-base);
    opacity: 0.7;
    font-weight: 500;
}

/* ============================================================
   FORM STYLES
   ============================================================ */
.portal-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.form-group {
    position: relative;
    animation: fieldSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(12px);
}
.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }
.form-group:nth-child(4) { animation-delay: 0.4s; }
.form-group:nth-child(5) { animation-delay: 0.5s; }

@keyframes fieldSlideIn {
    to { opacity: 1; transform: translateY(0); }
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--f-code);
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--n-base);
    opacity: 0.65;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.form-label i {
    font-size: 0.85rem;
    color: var(--c-neon-orange);
}
.form-label .required-star {
    color: #e74c3c;
    font-weight: 800;
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 16px 20px;
    border-radius: 12px;
    border: 1.5px solid rgba(56, 25, 50, 0.1);
    background: rgba(56, 25, 50, 0.02);
    font-size: 1rem;
    font-family: var(--f-main);
    color: var(--n-base);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    outline: none;
}
.form-input::placeholder {
    color: var(--n-base);
    opacity: 0.35;
    font-weight: 400;
}
.form-input:focus {
    border-color: var(--n-base);
    background: var(--n-pure);
    box-shadow: 0 0 0 4px rgba(56, 25, 50, 0.1);
}
.form-input:hover:not(:focus) {
    border-color: rgba(56, 25, 50, 0.2);
    background: rgba(56, 25, 50, 0.03);
}

/* Select element specific */
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23381932' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 20px center;
    background-size: 14px;
    padding-right: 50px;
    cursor: pointer;
}

/* Input icon prefix */
.input-wrapper {
    position: relative;
}
.input-wrapper .input-prefix {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--f-code);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--n-base);
    opacity: 0.5;
    pointer-events: none;
}
.input-wrapper .form-input.has-prefix {
    padding-left: 56px;
}

/* ============================================================
   PHOTO UPLOAD ZONE
   ============================================================ */
.photo-upload-zone {
    border: 2px dashed rgba(56, 25, 50, 0.15);
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    background: rgba(56, 25, 50, 0.01);
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
@media (hover: hover) {
    .photo-upload-zone:hover {
        border-color: var(--c-neon-orange);
        background: rgba(255, 121, 63, 0.03);
        transform: translateY(-2px);
    }
}
.photo-upload-zone.dragover {
    border-color: var(--c-neon-orange);
    background: rgba(255, 121, 63, 0.06);
    box-shadow: 0 0 0 4px rgba(255, 121, 63, 0.1);
}
.photo-upload-zone.has-photo {
    border-style: solid;
    border-color: var(--c-emerald);
    background: rgba(16, 185, 129, 0.03);
    padding: 12px;
}

.upload-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: rgba(255, 121, 63, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    transition: var(--t-fast);
}
.upload-icon i {
    font-size: 1.4rem;
    color: var(--c-neon-orange);
}
@media (hover: hover) {
    .photo-upload-zone:hover .upload-icon {
        background: rgba(255, 121, 63, 0.15);
        transform: scale(1.05);
    }
}

.upload-text {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--n-base);
    opacity: 0.8;
}
.upload-text span {
    color: var(--c-neon-orange);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.upload-hint {
    font-size: 0.75rem;
    font-family: var(--f-code);
    color: var(--n-base);
    opacity: 0.45;
}

/* Photo preview */
.photo-preview-container {
    display: none;
    width: 100%;
    position: relative;
}
.photo-preview-container.visible {
    display: block;
}
.photo-preview {
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: var(--sh-med);
}
.photo-remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: var(--t-fast);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
    backdrop-filter: blur(10px);
}
@media (hover: hover) {
    .photo-remove-btn:hover {
        background: #e74c3c;
        transform: scale(1.1);
    }
}

.upload-placeholder {
    transition: all 0.3s;
}
.photo-upload-zone.has-photo .upload-placeholder {
    display: none;
}

/* ============================================================
   SUBMIT BUTTON
   ============================================================ */
.submit-btn {
    width: 100%;
    padding: 18px 30px;
    background: linear-gradient(135deg, #381932 0%, #5a2c50 50%, #ff793f 100%);
    background-size: 200% auto;
    color: #FFF3E6;
    border: 2px solid transparent;
    border-radius: 14px;
    cursor: pointer;
    font-family: var(--f-main);
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: var(--sh-med), 0 8px 24px rgba(255, 121, 63, 0.15);
    position: relative;
    overflow: hidden;
    margin-top: 8px;
    animation: fieldSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
    opacity: 0;
    transform: translateY(12px);
}
@media (hover: hover) {
    .submit-btn:hover {
        background-position: right center;
        transform: translateY(-3px) scale(1.01);
        box-shadow: 0 20px 40px rgba(255, 121, 63, 0.25);
    }
}
.submit-btn:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 10px 20px rgba(255, 121, 63, 0.15);
}
.submit-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    transform: scale(0);
    transition: transform 0.6s ease;
}
.submit-btn:active::after { transform: scale(1); }

.submit-btn.loading {
    pointer-events: none;
    opacity: 0.85;
    background-position: right center;
}
.submit-btn .btn-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 243, 230, 0.3);
    border-top-color: #FFF3E6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.submit-btn.loading .btn-text { display: none; }
.submit-btn.loading .btn-spinner { display: block; }
.submit-btn.loading .btn-icon { display: none; }

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

/* ============================================================
   ERROR HIGHLIGHTS
   ============================================================ */
.error-hint {
    display: none;
    color: #e74c3c;
    font-size: 0.78rem;
    font-family: var(--f-code);
    font-weight: 500;
    margin-top: 6px;
    align-items: center;
    gap: 6px;
}
.error-hint::before {
    content: "\f071";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}
.form-group.has-error .error-hint {
    display: flex;
}
.form-group.has-error .form-input,
.form-group.has-error .photo-upload-zone {
    border-color: #e74c3c !important;
    background: rgba(231, 76, 60, 0.02) !important;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast {
    padding: 16px 22px;
    border-radius: 14px;
    font-size: 0.88rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--sh-mac);
    animation: toastIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    pointer-events: all;
    max-width: 400px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
.toast.success {
    background: rgba(16, 185, 129, 0.95);
    color: white;
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.toast.error {
    background: rgba(231, 76, 60, 0.95);
    color: white;
    border: 1px solid rgba(231, 76, 60, 0.3);
}
.toast.info {
    background: rgba(56, 25, 50, 0.95);
    color: var(--n-ghost);
    border: 1px solid rgba(56, 25, 50, 0.3);
}
.toast.removing {
    animation: toastOut 0.4s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(60px) scale(0.9); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to { opacity: 0; transform: translateX(60px) scale(0.9); }
}

/* ============================================================
   SUCCESS OVERLAY
   ============================================================ */
.success-overlay {
    position: fixed;
    inset: 0;
    background: rgba(56, 25, 50, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: overlayIn 0.3s ease forwards;
}
.success-overlay.visible {
    display: flex;
}
.success-modal {
    background: var(--n-pure);
    border-radius: 28px;
    padding: 50px 40px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    box-shadow: var(--sh-mac), 0 50px 100px rgba(0, 0, 0, 0.2);
    animation: modalBounce 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    position: relative;
    overflow: hidden;
}
.success-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--c-emerald), var(--c-neon-orange));
}
@keyframes overlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes modalBounce {
    from { opacity: 0; transform: scale(0.85) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.success-check {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--c-emerald), #059669);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
    animation: checkPop 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
    transform: scale(0);
}
@keyframes checkPop {
    to { transform: scale(1); }
}
.success-check i {
    font-size: 1.8rem;
    color: white;
}
.success-modal h2 {
    font-family: var(--f-wide);
    font-weight: 800;
    font-size: 1.6rem;
    color: var(--n-base);
    margin-bottom: 8px;
}
.success-modal p {
    font-size: 0.92rem;
    color: var(--n-base);
    opacity: 0.7;
    margin-bottom: 25px;
    line-height: 1.5;
}
.new-entry-btn {
    padding: 14px 30px;
    background: var(--n-base);
    color: var(--n-ghost);
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--t-fast);
    font-family: var(--f-main);
}
@media (hover: hover) {
    .new-entry-btn:hover {
        background: var(--p-light);
        transform: translateY(-2px);
        box-shadow: var(--sh-med);
    }
}

/* ============================================================
   FOOTER
   ============================================================ */
.portal-footer {
    text-align: center;
    padding: 20px;
    font-family: var(--f-code);
    font-size: 0.7rem;
    color: var(--n-base);
    opacity: 0.4;
    letter-spacing: 0.5px;
}
.portal-footer a {
    color: inherit;
    text-decoration: underline;
}
