/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;700&display=swap');

:root {
    --bg-color: #0f0f15;
    --card-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #a0a0ba;
    --accent-gradient: linear-gradient(135deg, #00f260 0%, #0575e6 100%);
    --accent-color: #0575e6;
    --error-color: #ff4b4b;
    --btn-glass: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    /* Fallback */
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.app-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-color: var(--bg-color);
    background-image:
        radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
    background-repeat: no-repeat;
    background-size: cover;
}

/* Background Animation Effect on the fixed container */
.app-background::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    z-index: -1;
    animation: moveGrid 60s linear infinite;
}

@keyframes moveGrid {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(30px);
    }
}

.container {
    width: 90%;
    max-width: 500px;
    padding: 40px;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
    text-align: center;
    position: relative;
    z-index: 10;
    animation: fadeIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 30px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.label-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    display: block;
}

/* Auth Form Styles */
.auth-input-group {
    margin-bottom: 20px;
}

#passcode-display {
    width: 100%;
    padding: 16px;
    font-size: 1.5rem;
    text-align: center;
    letter-spacing: 5px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    outline: none;
    cursor: pointer;
    transition: border-color 0.3s;
}

#passcode-display:focus {
    border-color: var(--accent-color);
}

.auth-btn {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background: var(--accent-gradient);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(5, 117, 230, 0.3);
}

.error-message {
    color: var(--error-color);
    margin-top: 15px;
    font-size: 0.9rem;
    min-height: 1.2em;
}

/* Inline Keypad */
.keypad-container {
    background: rgba(255, 255, 255, 0.02);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    margin-bottom: 20px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.keypad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    justify-items: center;
}

/* Center the last item (10th item in a 3-column grid) */
.keypad-grid .key-btn:last-child {
    grid-column: 2;
}

.key-btn {
    width: 60px;
    height: 60px;
    font-size: 1.4rem;
    font-weight: 500;
    color: white;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.action-btn {
    flex: 1;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.primary-action {
    background: var(--accent-gradient);
    color: white;
    border: none;
    font-weight: 600;
}

.primary-action:hover {
    box-shadow: 0 5px 15px rgba(5, 117, 230, 0.3);
    transform: translateY(-1px);
}

.key-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

.key-btn:active {
    background: var(--accent-color);
    transform: scale(0.95);
}

.close-modal {
    width: 100%;
    padding: 12px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 10px;
}

.close-modal:hover {
    color: white;
}

/* Home Page Styles */
.nav-buttons {
    display: grid;
    gap: 20px;
    margin-top: 40px;
}

.nav-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    text-decoration: none;
    color: white;
    background: var(--btn-glass);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    font-size: 1.2rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.nav-btn:hover {
    transform: translateY(-3px);
    border-color: transparent;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(255, 75, 75, 0.9);
    /* Error red by default */
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.toast-notification.success {
    background: rgba(0, 242, 96, 0.9);
    /* Green */
}