/* ==========================================================================
   MetaForm — Custom Styles
   ========================================================================== */

* {
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-feature-settings: 'cv11', 'ss01', 'ss03';
}

/* --- Animated Gradient Orbs --- */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.55;
    pointer-events: none;
    animation: float 22s infinite ease-in-out;
    will-change: transform;
}

.orb-1 {
    width: 480px;
    height: 480px;
    background: oklch(0.65 0.28 290);
    top: -180px;
    left: -180px;
}

.orb-2 {
    width: 520px;
    height: 520px;
    background: oklch(0.62 0.25 340);
    bottom: -220px;
    right: -200px;
    animation-delay: -7s;
    animation-duration: 26s;
}

.orb-3 {
    width: 360px;
    height: 360px;
    background: oklch(0.6 0.25 230);
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
    animation-duration: 30s;
    opacity: 0.4;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25%      { transform: translate(60px, -40px) scale(1.08); }
    50%      { transform: translate(-30px, 50px) scale(0.95); }
    75%      { transform: translate(40px, 30px) scale(1.05); }
}

/* --- Grain Overlay --- */
.grain {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.06;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --- Glass Card --- */
.glass-card {
    background: linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.07) 0%,
        rgba(255, 255, 255, 0.03) 100%
    );
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 20px 60px -10px rgba(0, 0, 0, 0.5),
        0 1px 0 0 rgba(255, 255, 255, 0.05) inset;
}

/* --- Floating-label Inputs --- */
.form-field {
    position: relative;
}

.form-field input {
    width: 100%;
    padding: 22px 44px 8px 16px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    color: #fff;
    font-size: 16px;
    font-family: inherit;
    font-weight: 500;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.form-field input::-webkit-outer-spin-button,
.form-field input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.form-field input[type=number] {
    -moz-appearance: textfield;
}

.form-field input:hover:not(:focus) {
    border-color: rgba(255, 255, 255, 0.18);
}

.form-field input:focus {
    border-color: oklch(0.72 0.22 290);
    background: rgba(255, 255, 255, 0.04);
    box-shadow:
        0 0 0 4px oklch(0.7 0.2 290 / 0.18),
        0 0 30px oklch(0.65 0.25 290 / 0.15);
}

.form-field input:-webkit-autofill {
    -webkit-text-fill-color: #fff;
    -webkit-box-shadow: 0 0 0 30px rgba(40, 30, 60, 0.95) inset !important;
    caret-color: #fff;
}

.form-field label {
    position: absolute;
    top: 18px;
    left: 16px;
    color: rgba(255, 255, 255, 0.45);
    pointer-events: none;
    transition: top 0.18s ease, font-size 0.18s ease, color 0.18s ease;
    font-size: 15px;
    font-weight: 400;
    background: transparent;
    z-index: 1;
}

.form-field input:focus ~ label,
.form-field input:not(:placeholder-shown) ~ label {
    top: 7px;
    font-size: 11px;
    font-weight: 600;
    color: oklch(0.85 0.15 290);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.field-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.3);
    pointer-events: none;
    transition: color 0.2s;
}

.form-field input:focus ~ .field-icon {
    color: oklch(0.75 0.18 290);
}

/* --- Custom Checkbox --- */
.custom-check {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s;
}

.custom-check:hover {
    border-color: rgba(255, 255, 255, 0.4);
}

.custom-check:checked {
    background: linear-gradient(135deg, oklch(0.65 0.25 290), oklch(0.65 0.22 340));
    border-color: transparent;
}

.custom-check:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-check:focus-visible {
    box-shadow: 0 0 0 3px oklch(0.7 0.2 290 / 0.3);
    outline: none;
}

/* --- Honeypot (hidden but accessible) --- */
.hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/* --- Shimmer Button --- */
.shimmer-btn {
    position: relative;
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(120deg,
        oklch(0.62 0.25 290) 0%,
        oklch(0.62 0.25 320) 50%,
        oklch(0.62 0.25 340) 100%
    );
    border: none;
    border-radius: 14px;
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.25s ease;
    box-shadow:
        0 10px 30px -10px oklch(0.6 0.25 320 / 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.shimmer-btn:hover {
    transform: translateY(-1px);
    box-shadow:
        0 14px 40px -10px oklch(0.6 0.25 320 / 0.8),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

.shimmer-btn:active {
    transform: translateY(0);
}

.shimmer-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    animation: shimmer 3.5s infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0%   { left: -60%; }
    100% { left: 160%; }
}

.shimmer-btn .btn-loading {
    display: none;
}

.shimmer-btn .btn-arrow {
    transition: transform 0.2s;
}

.shimmer-btn:hover .btn-arrow {
    transform: translateX(3px);
}

.shimmer-btn.is-loading .btn-text,
.shimmer-btn.is-loading .btn-arrow {
    display: none;
}

.shimmer-btn.is-loading .btn-loading {
    display: inline-flex;
}

.shimmer-btn:disabled {
    opacity: 0.85;
    cursor: wait;
}

/* --- Fade-in --- */
.fade-in {
    animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

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

/* --- Success Check Animation --- */
.success-check svg {
    filter: drop-shadow(0 0 40px oklch(0.7 0.25 320 / 0.4));
}

.success-circle {
    stroke-dasharray: 226;
    stroke-dashoffset: 226;
    animation: drawCircle 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
}

.success-tick {
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
    animation: drawTick 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.7s forwards;
}

@keyframes drawCircle {
    to { stroke-dashoffset: 0; }
}

@keyframes drawTick {
    to { stroke-dashoffset: 0; }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    .orb { animation: none; }
    .shimmer-btn::before { animation: none; opacity: 0; }
    .fade-in { animation: none; }
}

/* --- Mobile --- */
@media (max-width: 480px) {
    .orb { filter: blur(70px); }
    .orb-1 { width: 320px; height: 320px; }
    .orb-2 { width: 360px; height: 360px; }
    .orb-3 { width: 260px; height: 260px; }
}
