@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap");

:root {
    --bg: #f4f5f8;
    /* Soft light background */
    --primary: #6A5AE0;
    /* Your requested primary color */
    --primary-hover: #5949d0;
    --white: #ffffff;
    --text-main: #2b2839;
    /* Deep dark violet/gray for text */
    --text-muted: #827f98;

    /* Light Glassmorphism Variables */
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.8);
    --font-family: 'Montserrat', sans-serif;
    --card-shadow: rgba(106, 90, 224, 0.08);
}

.dark-theme {
    --bg: #000000;
    --white: #ffffff;
    --text-main: #ffffff;
    --text-muted: #aaa;
    --glass-bg: rgba(24, 24, 24, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(255, 255, 255, 0.05);
    --card-shadow: rgba(0, 0, 0, 0.5);
    color-scheme: dark;
}

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

html, body {
    height: 100%;
    height: -webkit-fill-available;
    background: var(--bg);
    color: var(--text-main);
    font-family: var(--font-family);
    overflow: hidden;
    position: fixed; /* Extra lock for mobile */
    width: 100%;
}

/* App Iframe Container */
#app-container {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: none;
}

#app-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

#login-wrapper {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
}

/* Generated Texture Pattern */
#texture {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 1;
}

.element {
    transition: all 1.5s ease-in-out;
}

/* Centered Glassmorphism Container */
.login-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    padding: 20px;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 40px var(--card-shadow);
    /* Soft primary-tinted shadow */
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Typography & Header */
#hero-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 0.2rem;
}

#logo {
    font-size: 2.5rem;
    color: var(--primary);
}

#hero-head h1 {
    font-size: 2.2rem;
    font-weight: 700;
}

.subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Inputs & Buttons */
.content {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

input {
    width: 100%;
    padding: 1rem 1.2rem;
    font-size: 1rem;
    background: var(--input-bg);
    color: var(--text-main);
    border-radius: 12px;
    outline: none;
    border: 1px solid var(--glass-border);
    font-family: var(--font-family);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    text-align: center;
}

input::placeholder {
    color: #aeb0c0;
    font-weight: 400;
}

input:focus {
    border: 1px solid var(--primary);
    background: var(--white);
    box-shadow: 0 0 15px rgba(106, 90, 224, 0.15);
    transform: scale(1.01);
}

.dark-theme input:focus {
    background: rgba(255, 255, 255, 0.08);
}

input:disabled {
    opacity: 0.6;
    background: rgba(0,0,0,0.05);
    cursor: not-allowed;
    transform: none !important;
}

/* Specific styling to make the PIN look like a passcode field */
#pin {
    letter-spacing: 0.8rem;
    padding-left: 1.8rem; /* Center the characters properly including spacing */
    text-align: center;
    font-weight: 700;
    font-size: 1.2rem;
}

#pin::placeholder {
    letter-spacing: normal;
    padding-left: 0;
    text-align: center;
    font-size: 1rem;
    font-weight: 400;
}

.submit-btn {
    width: 100%;
    padding: 1.1rem;
    font-size: 1.1rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 0.5rem;
    box-shadow: 0 4px 12px rgba(106, 90, 224, 0.2);
}

.submit-btn:hover:not(:disabled) {
    background: var(--primary-hover);
    box-shadow: 0 8px 24px rgba(106, 90, 224, 0.35);
    transform: translateY(-2px);
}

.submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.5;
    background: #aeb0c0;
    cursor: not-allowed;
    box-shadow: none;
}

/* Footer info */
#version-display {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    font-weight: 500;
}

#credit {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Light Mode Toast Notifications */
.toast {
    display: none;
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    min-width: 250px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.tactive {
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.toast-content .bx {
    font-size: 2rem;
    color: var(--primary);
}

.message {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.text-1 {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-main);
}

.text-2 {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.toast .bx-x {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-muted);
}

.toast .bx-x:hover {
    color: var(--primary);
}