/* RESET */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    height: 100vh;
    font-family: 'Inter', sans-serif;
    overflow: hidden;
}

/* SKY / CLOUD BACKGROUND */
.sky {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.9), transparent 40%),
        radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.8), transparent 45%),
        linear-gradient(to bottom, #bfe9ff, #eaf6ff);
    animation: floatSky 18s ease-in-out infinite alternate;
    z-index: -1;
}

@keyframes floatSky {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.06);
    }
}

/* CENTER WRAPPER */
.login-wrapper {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* LOGIN CARD */
.login-card {
    width: 390px;
    padding: 40px 38px;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(18px);
    border-radius: 22px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.15);
    text-align: center;
    animation: fadeUp 1s ease forwards;
}

@keyframes fadeUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* TOP ICON */
/* TOP LOGO */
.login-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 10px;
    object-fit: contain;
    display: block;
    border-radius: 12px;
}

/* TEXT */
.login-card h1 {
    font-size: 24px;
    font-weight: 600;
    color: #0f172a;
}

.subtitle {
    font-size: 13px;
    color: #475569;
    margin: 10px 0 28px;
}

/* INPUT FIELD */
.field {
    position: relative;
    margin-bottom: 22px;
    text-align: left;
}

.field input {
    width: 100%;
    padding: 15px 14px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    background: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    outline: none;
}

.field input:focus {
    border-color: #2563eb;
}

/* FLOATING LABEL */
.field label {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: #64748b;
    pointer-events: none;
    transition: 0.25s;
    background: transparent;
}

.field input:focus+label,
.field input:not(:placeholder-shown)+label {
    top: -7px;
    font-size: 11px;
    color: #2563eb;
    background: #ffffff;
    padding: 0 6px;
}

/* PASSWORD EYE */
.eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 14px;
}

/* BUTTON */
.login-card button {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(to bottom, #0f172a, #020617);
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.3s;
}

.login-card button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* MOBILE */
@media (max-width: 480px) {
    .login-card {
        width: 92%;
        padding: 34px 26px;
    }
}

/* FOOTER */
.login-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    color: #64748b;
    /* Slate-500 */
    font-size: 14px;
    font-weight: 500;
    z-index: 10;
    pointer-events: none;
    /* Let clicks pass through if needed, though text might be selectable */
}

@media (max-width: 480px) {
    .login-footer {
        padding: 15px 20px;
        font-size: 12px;
    }
}

/* APK DOWNLOAD SECTION - RELOADED */
#apk-container-v2 {
    position: fixed;
    top: 30px;
    left: 35px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 500;
}

.apk-btn-v2 {
    position: relative;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #0f172a;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    z-index: 510;
    /* Top Layer */
}

.apk-btn-v2:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.apk-prompt-v2 {
    position: relative;
    margin-top: -40px;
    /* Start BEHIND the button */
    padding: 6px 14px;
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    z-index: 505;
    /* Middle Layer */
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    animation: apkSlideDown 1.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards 0.5s,
        apkBounce 2s infinite ease-in-out 2s;
}

@keyframes apkSlideDown {
    from {
        margin-top: -40px;
        opacity: 0;
    }

    to {
        margin-top: 12px;
        opacity: 1;
    }
}

@keyframes apkBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(5px);
    }
}

/* APP DETECT HIDER - UPDATED */
.is-app #apk-container-v2,
.is-app .apk-prompt-v2 {
    display: none !important;
}

/* CUSTOM POPUP - RESTORED */
.apk-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.apk-modal-content {
    background: white;
    padding: 35px;
    border-radius: 24px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.apk-modal-icon {
    font-size: 40px;
    margin-bottom: 20px;
    display: block;
}

.apk-modal-text {
    font-size: 16px;
    line-height: 1.6;
    color: #334155;
    margin-bottom: 25px;
    font-weight: 500;
}

.apk-modal-btn {
    background: #0f172a;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.apk-modal-btn:hover {
    background: #1e293b;
    transform: scale(1.05);
}

/* OPTIONS MENU (TOP RIGHT) */
.options-menu {
    position: fixed;
    top: 25px;
    right: 25px;
    z-index: 2000;
}

.options-trigger {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #1e293b;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.options-trigger:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
}

.options-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
    padding: 10px;
    min-width: 220px;
    display: none;
    /* Controlled by JS */
    flex-direction: column;
    gap: 4px;
    z-index: 2001;
    transform-origin: top right;
    animation: menuFadeIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes menuFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.options-dropdown a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 14px;
    text-decoration: none;
    color: #334155;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.options-dropdown a span {
    font-size: 18px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.options-dropdown a:hover {
    background: rgba(37, 99, 235, 0.08);
    color: #2563eb;
    padding-left: 20px;
}

.options-dropdown a.delete-link {
    color: #ef4444;
}

.options-dropdown a.delete-link:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
}

/* Hide when in app */
.is-app .options-menu {
    display: none !important;
}