* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    overflow: hidden;
}

.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(-45deg, #667eea, #764ba2, #f093fb, #f5576c, #4facfe, #00f2fe);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(1px);
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

.container {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 30px 25px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 450px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    animation: slideUp 0.8s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 35px 70px rgba(0, 0, 0, 0.25);
}

.title {
    color: #64748b;
    font-size: 16px;
    margin-bottom: 50px;
    font-weight: 400;
    line-height: 1.5;
}

.footer-text {
    margin-top: 40px;
    color: #94a3b8;
    font-size: 14px;
    line-height: 1.6;
}

.footer-text a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-text a:hover {
    color: #764ba2;
}

.logo-section {
    position: fixed;
    top: 30px;
    left: 30px;
    z-index: 20;
}

.logo-section a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
}

.logo-mark img {
    width: 36px;
    height: 36px;
}

.logo-name {
    font-size: 46px;
    font-weight: 600;
    color: white;
    letter-spacing: -.01em;
}

.logo {
    font-size: 46px;
    font-weight: 800;
    color: white;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.language-selector {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 20;
    /* Vertically center relative to the logo-section (36px icon + line-height) */
    height: 36px;
    display: flex;
    align-items: center;
}

.language-dropdown {
    position: relative;
    display: inline-block;
}

.language-button {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 12px 16px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    min-width: 120px;
    justify-content: space-between;
}

.language-button:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.language-flag {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    display: inline-block;
}

.flag-de { background-image: url("https://cdn.onylab.com/image/flag/4x3/de.svg"); }
.flag-en { background-image: url("https://cdn.onylab.com/image/flag/4x3/gb.svg"); }
.flag-es { background-image: url("https://cdn.onylab.com/image/flag/4x3/es.svg"); }
.flag-fr { background-image: url("https://cdn.onylab.com/image/flag/4x3/fr.svg"); }
.flag-pt { background-image: url("https://cdn.onylab.com/image/flag/4x3/pt.svg"); }
.flag-ar { display: none; }

.dropdown-arrow {
    transition: transform 0.3s ease;
    font-size: 12px;
}

.dropdown-arrow.open {
    transform: rotate(180deg);
}

.language-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    min-width: 160px;
    overflow: hidden;
}

.language-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.language-option:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.language-option.active {
    background: rgba(102, 126, 234, 0.15);
    color: #667eea;
    font-weight: 600;
}

@media (max-width: 640px) {
    .login-card {
        padding: 20px 15px;
        margin: 10px;
        border-radius: 20px;
    }
    
    .logo {
        font-size: 38px;
    }

    .logo-section {
        top: 20px;
        left: 20px;
    }

    .language-selector {
        top: 20px;
        right: 20px;
    }

    .language-button {
        padding: 10px 12px;
        font-size: 13px;
        min-width: 100px;
    }

    .language-menu {
        min-width: 140px;
    }

    .language-option {
        padding: 10px 12px;
        font-size: 13px;
    }
}

.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: twinkle 3s infinite ease-in-out;
}

@keyframes twinkle {
    0%, 100% { opacity: 0; transform: scale(0); }
    50% { opacity: 1; transform: scale(1); }
}

/* APPS */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

/* Flip card wrapper — replaces direct app-card sizing */
.app-card-wrapper {
    perspective: 1000px;
    aspect-ratio: 1;
}

.app-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
    position: relative;
    /* Flip card */
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.55s ease, box-shadow 0.3s ease;
}

.app-card:hover {
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.app-card.flipped {
    transform: rotateY(180deg);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.app-card:active {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Front & back faces */
.app-card__face {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.app-card__face--front {
    /* inherits card background */
}

.app-card__face--back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    line-height: 1.5;
    letter-spacing: 0.3px;
}

.app-card.app .app-card__face--back {
    background: linear-gradient(135deg, #2e2e2e 0%, #3c3c3c 100%);
}



.app-card.app {
    background: linear-gradient(135deg, #2e2e2e 0%, #3c3c3c 100%);
}

.app-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: white;
    backdrop-filter: blur(10px);
}

.app-icon img {
    width: 100%;
}

.app-name {
    color: white;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.5px;
}

.app-badge-section {
    position: absolute;
    top: 5%;
    right: 5%;
    display: flex;
    align-items: center;
    gap: 2%;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 99px;
}

.app-badge {
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 99px;
}

.app-badge-email {
  background: rgba(34,197,94,.12);
  color: #4ade80;
  border: 1px solid rgba(74,222,128,.2);
}

.app-badge-sms {
  background: rgba(251,191,36,.12);
  color: #fbbf24;
  border: 1px solid rgba(251,191,36,.2);
}

.app-badge-order {
  background: rgba(56,189,248,.12);
  color: #38bdf8;
  border: 1px solid rgba(56,189,248,.2);
}

.app-badge-marketing {
  background: rgba(167,139,250,.12);
  color: #c4b5fd;
  border: 1px solid rgba(167,139,250,.2);
}

@media (max-width: 640px) {
    .apps-grid {
        gap: 16px;
    }

    .app-card {
        padding: 20px;
    }

    .app-card__face {
        padding: 20px;
    }

    .app-icon {
        width: 48px;
        height: 48px;
        font-size: 24px;
        border-radius: 12px;
    }

    .app-name {
        font-size: 12px;
    }
}