/* ========================================================================
   ilegis.cloud — Launchpad
   Stil Apple / glassmorphism, fundal animat, hover 3D
   ======================================================================== */

:root {
    --bg-0: #07070f;
    --bg-1: #0d0d1c;
    --text: #eef1ff;
    --text-dim: #9aa0c0;
    --card: rgba(255, 255, 255, 0.06);
    --card-border: rgba(255, 255, 255, 0.12);
    --radius: 26px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    background: var(--bg-0);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
}

/* ---------- Fundal animat ---------- */
.bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background:
        radial-gradient(1200px 800px at 20% -10%, #14163a 0%, transparent 60%),
        radial-gradient(1000px 700px at 90% 10%, #1b1030 0%, transparent 55%),
        linear-gradient(160deg, var(--bg-1), var(--bg-0));
}

/* Camp de stele — doua straturi la adancimi diferite */
.bg-stars {
    position: absolute;
    inset: -100px;
    background-repeat: repeat;
    background-image:
        radial-gradient(1.6px 1.6px at 40px 60px, rgba(255, 255, 255, 0.9), transparent),
        radial-gradient(1.4px 1.4px at 130px 180px, rgba(190, 210, 255, 0.8), transparent),
        radial-gradient(1.2px 1.2px at 230px 90px, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(1.8px 1.8px at 320px 250px, rgba(210, 190, 255, 0.85), transparent),
        radial-gradient(1.2px 1.2px at 90px 300px, rgba(255, 255, 255, 0.6), transparent);
    background-size: 360px 360px;
    opacity: 0.6;
    animation: driftStars 140s linear infinite;
}

.bg-stars::after {
    content: "";
    position: absolute;
    inset: 0;
    background-repeat: repeat;
    background-image:
        radial-gradient(1px 1px at 70px 120px, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(1px 1px at 180px 40px, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(1px 1px at 260px 200px, rgba(180, 200, 255, 0.45), transparent),
        radial-gradient(1px 1px at 20px 220px, rgba(255, 255, 255, 0.35), transparent);
    background-size: 220px 220px;
    opacity: 0.7;
    animation: twinkle 6s ease-in-out infinite alternate;
}

@keyframes driftStars {
    to { transform: translate3d(-360px, -360px, 0); }
}

@keyframes twinkle {
    0%   { opacity: 0.35; }
    100% { opacity: 0.8; }
}

/* Particule/constelatie pe canvas */
.bg-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.75;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.55;
    will-change: transform;
}

.orb--1 {
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, #2f6bff, transparent 70%);
    top: -120px;
    left: -80px;
    animation: float1 18s var(--ease) infinite;
}

.orb--2 {
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, #8b5cf6, transparent 70%);
    bottom: -160px;
    right: -100px;
    animation: float2 22s var(--ease) infinite;
}

.orb--3 {
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, #10b981, transparent 70%);
    top: 40%;
    left: 55%;
    opacity: 0.35;
    animation: float3 26s var(--ease) infinite;
}

@keyframes float1 {
    50% { transform: translate(120px, 80px) scale(1.1); }
}
@keyframes float2 {
    50% { transform: translate(-100px, -70px) scale(1.15); }
}
@keyframes float3 {
    50% { transform: translate(-80px, 60px) scale(0.9); }
}

.noise {
    position: absolute;
    inset: 0;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
}

/* ---------- Layout ---------- */
.stage {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 56px;
    padding: 64px 24px;
}

/* ---------- Hero ---------- */
.hero {
    text-align: center;
    animation: rise 0.9s var(--ease) both;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: lowercase;
    color: var(--text);
    padding: 7px 16px;
    border: 1px solid var(--card-border);
    border-radius: 999px;
    background: var(--card);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    margin-bottom: 26px;
}

.brand-muted { color: var(--text-dim); }

.brand-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #2f6bff;
    box-shadow: 0 0 14px #2f6bff;
    animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
    50% { opacity: 0.4; transform: scale(0.8); }
}

.title {
    font-size: clamp(32px, 6vw, 60px);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.05;
    background: linear-gradient(180deg, #ffffff, #b9c0f0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    margin-top: 14px;
    font-size: clamp(15px, 2vw, 19px);
    color: var(--text-dim);
    font-weight: 500;
}

/* ---------- Launchpad grid ---------- */
.launchpad {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(28px, 4vw, 60px);
    max-width: 920px;
    width: 100%;
    perspective: 1000px;
}

/* ---------- App icon ---------- */
.app {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: var(--text);
    transform-style: preserve-3d;
    transition: transform 0.5s var(--ease);
    animation: popIn 0.7s var(--ease) both;
    animation-delay: var(--delay);
    outline: none;
}

/* ---------- Tooltip ---------- */
.app-tip {
    position: absolute;
    bottom: calc(100% + 16px);
    left: 50%;
    width: max-content;
    max-width: 240px;
    transform: translate(-50%, 8px);
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(18, 18, 34, 0.72);
    border: 1px solid var(--card-border);
    box-shadow: 0 20px 50px -16px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(18px) saturate(1.2);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    text-align: left;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
    transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.app-tip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    margin-top: -6px;
    width: 12px;
    height: 12px;
    background: rgba(18, 18, 34, 0.72);
    border-right: 1px solid var(--card-border);
    border-bottom: 1px solid var(--card-border);
}

.app-tip-title {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #fff;
}

.app-tip-text {
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--text-dim);
}

.app-tip-go {
    margin-top: 4px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--accent);
    filter: brightness(1.35);
}

.app:hover .app-tip,
.app:focus-visible .app-tip {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (hover: none) {
    .app-tip { display: none; }
}

@keyframes popIn {
    from { opacity: 0; transform: translateY(26px) scale(0.86); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.app-icon {
    position: relative;
    width: clamp(92px, 12vw, 128px);
    height: clamp(92px, 12vw, 128px);
    border-radius: 30%;
    display: grid;
    place-items: center;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.03)),
        color-mix(in srgb, var(--accent) 22%, #121225);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow:
        0 20px 40px -14px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset,
        0 2px 2px rgba(255, 255, 255, 0.25) inset;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    overflow: hidden;
    transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
    transform: translateZ(0);
}

.app-glow {
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle at 50% 30%, var(--accent), transparent 60%);
    opacity: 0;
    transition: opacity 0.5s var(--ease);
    filter: blur(24px);
}

.app-shine {
    position: absolute;
    z-index: 2;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transform: skewX(-18deg);
    transition: left 0.7s var(--ease);
    pointer-events: none;
}

.app-logo {
    position: relative;
    z-index: 1;
    display: block;
}

/* fit = full : sigla este deja un icon patrat, umple squircle-ul */
.app-icon--full {
    background: #0d0d1c;
}

.app-icon--full .app-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* fit = wide : logo orizontal pe o placuta alba, cu padding */
.app-icon--wide {
    background:
        linear-gradient(160deg, #ffffff, #eef1f7);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow:
        0 20px 40px -14px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(0, 0, 0, 0.04) inset,
        0 2px 2px rgba(255, 255, 255, 0.9) inset;
}

.app-icon--wide .app-logo {
    width: 82%;
    height: 82%;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.app-fallback {
    position: relative;
    z-index: 1;
    font-size: clamp(30px, 4vw, 42px);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.app-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-align: center;
}

.app-name {
    font-size: clamp(14px, 1.6vw, 16px);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.app-tag {
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 500;
}

/* Hover / focus */
.app:hover .app-icon,
.app:focus-visible .app-icon {
    box-shadow:
        0 30px 60px -16px rgba(0, 0, 0, 0.7),
        0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent),
        0 0 40px -6px var(--accent),
        0 2px 2px rgba(255, 255, 255, 0.3) inset;
}

.app:hover .app-glow,
.app:focus-visible .app-glow {
    opacity: 0.6;
}

.app:hover .app-shine {
    left: 160%;
}

.app:hover .app-name {
    color: #fff;
}

.app:focus-visible {
    border-radius: var(--radius);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 60%, transparent);
}

.app:active .app-icon {
    transform: scale(0.94);
}

/* ---------- Footer ---------- */
.foot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-dim);
    animation: rise 1.1s var(--ease) both;
}

.foot-line {
    display: flex;
    align-items: center;
    gap: 10px;
}

.foot-sep { opacity: 0.5; }

.foot-ctce {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    background: var(--card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    text-decoration: none;
    color: var(--text-dim);
    transition: border-color 0.3s var(--ease), transform 0.3s var(--ease), background 0.3s var(--ease);
}

.foot-ctce:hover {
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.09);
    transform: translateY(-1px);
}

.foot-ctce-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.8;
}

.foot-ctce img {
    height: 20px;
    width: auto;
    display: block;
}

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

/* ---------- Buton "Află mai mult" din tooltip ---------- */
.app-tip-more {
    margin-top: 6px;
    align-self: flex-start;
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: 999px;
    padding: 7px 14px;
    cursor: pointer;
    pointer-events: auto;
    transition: filter 0.25s var(--ease), transform 0.25s var(--ease);
}

.app-tip-more:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
}

/* Tooltip-ul trebuie sa fie clicabil cand are buton */
.app:hover .app-tip,
.app:focus-visible .app-tip,
.app-tip:hover {
    pointer-events: auto;
}

/* ---------- Modal ---------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 24px;
}

.modal[hidden] { display: none; }

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 5, 12, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.3s var(--ease);
}

.modal-card {
    position: relative;
    width: min(560px, 100%);
    max-height: 86vh;
    overflow-y: auto;
    padding: 34px 34px 30px;
    border-radius: 24px;
    background:
        radial-gradient(600px 300px at 0% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
        rgba(20, 20, 38, 0.92);
    border: 1px solid var(--card-border);
    box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    animation: modalIn 0.45s var(--ease);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn {
    from { opacity: 0; transform: translateY(24px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    font-size: 24px;
    line-height: 1;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--card-border);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.25s var(--ease), color 0.25s var(--ease);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.modal-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.modal-icon {
    width: 64px;
    height: 64px;
    flex: 0 0 auto;
    border-radius: 24%;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.modal-icon.app-icon--wide {
    background: linear-gradient(160deg, #ffffff, #eef1f7);
}

.modal-icon.app-icon--full { background: #0d0d1c; }

.modal-icon img {
    width: 82%;
    height: 82%;
    object-fit: contain;
}

.modal-icon.app-icon--full img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
}

.modal-tag {
    font-size: 13px;
    color: var(--accent);
    filter: brightness(1.35);
    font-weight: 600;
    margin-top: 2px;
}

.modal-tagline {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    color: #eef1ff;
    padding: 14px 16px;
    border-left: 3px solid var(--accent);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 0 12px 12px 0;
    margin-bottom: 22px;
}

.modal-sections {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 26px;
}

.modal-section h3 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    filter: brightness(1.3);
    margin-bottom: 6px;
}

.modal-section p {
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--text-dim);
}

.modal-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 22px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 14.5px;
    text-decoration: none;
    transition: filter 0.25s var(--ease), transform 0.25s var(--ease);
}

.modal-cta:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
}

body.modal-open { overflow: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
    .launchpad { grid-template-columns: repeat(2, 1fr); max-width: 420px; }
    .stage { gap: 44px; }
}

@media (max-width: 360px) {
    .launchpad { gap: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}
