@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #000000;
    --secondary: #1a1a1a;
    --accent: #00ff88;
    --accent-dim: #00cc6a;
    --bg-dark: #0a0a0a;
    --bg-darker: #050505;
    --text-light: #ffffff;
    --text-gray: #a0a0a0;
    --border-color: #2a2a2a;
    --glass-bg: rgba(26, 26, 26, 0.8);
    --glass-border: rgba(255, 255, 255, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-dark);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    overflow-x: hidden;
    position: relative;
}

/* Dynamic Background Elements */
.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, #111 0%, #000 100%);
}

.blob {
    position: absolute;
    width: 400px;
    height: 400px;
    background: var(--accent);
    filter: blur(120px);
    border-radius: 50%;
    opacity: 0.05;
    animation: move 20s infinite alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    background: var(--accent);
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    background: #00d2ff;
    animation-delay: -5s;
}

@keyframes move {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(100px, 100px) scale(1.2);
    }
}

.login-container {
    width: 95%;
    max-width: 440px;
    padding: 2rem 1.75rem;
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 1;
    margin: 1.5rem auto;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, var(--accent), transparent, var(--accent));
    border-radius: 26px;
    z-index: -1;
    opacity: 0.1;
}

.logo-section {
    text-align: center;
    margin-bottom: 1.5rem;
}

.logo-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    font-size: 1.75rem;
    color: var(--primary);
    box-shadow: 0 10px 20px rgba(0, 255, 136, 0.2);
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    padding: 5px;
}

.login-header h2 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #a0a0a0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.login-header p {
    color: var(--text-gray);
    font-size: 0.95rem;
}

/* Form Styles */
.form-label {
    display: block;
    color: var(--text-gray);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    margin-left: 0.25rem;
}

.input-group-modern {
    position: relative;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.input-group-modern i.prefix-icon,
.input-group-modern>i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-gray);
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
    pointer-events: none;
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-group-modern.is-active i.prefix-icon,
.input-group-modern.is-active>i {
    color: var(--accent);
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.4);
}

.input-group-modern.is-active .form-control {
    border-color: var(--accent);
    background: rgba(0, 255, 136, 0.03);
    box-shadow: 0 0 0 4px rgba(0, 255, 136, 0.1);
    color: white;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.5rem;
    transition: all 0.3s ease;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: var(--accent);
}

.input-group-modern.is-active .password-toggle {
    color: var(--text-gray);
}

.form-control::placeholder {
    color: rgba(160, 160, 160, 0.4);
}

/* Buttons */
.btn-login {
    width: 100%;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
    color: var(--primary);
    border: none;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1rem;
    box-shadow: 0 10px 20px rgba(0, 255, 136, 0.15);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(0, 255, 136, 0.25);
    filter: brightness(1.05);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-google {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color) !important;
    color: var(--text-light) !important;
    padding: 0.875rem;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
}

.btn-google:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.divider {
    display: flex;
    align-items: center;
    margin: 1.25rem 0;
    gap: 1rem;
    color: var(--text-gray);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.footer-links {
    text-align: center;
    margin-top: 1.25rem;
    color: var(--text-gray);
    font-size: 0.9rem;
}

.footer-links a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.footer-links a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 14px;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    line-height: 1.4;
    animation: shake 0.65s cubic-bezier(.36, .07, .19, .97) both;
}

.alert-danger {
    background: rgba(255, 71, 87, 0.08);
    border-color: rgba(255, 71, 87, 0.2);
    color: #ff6b81;
}

.alert-danger i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tenant selection override */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23a0a0a0'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
    padding-left: 2.75rem;
}

/* Responsive */
@media (max-width: 576px) {
    .login-container {
        padding: 2.25rem 1.25rem;
        border-radius: 24px;
        width: 94%;
        margin: 1rem auto;
    }

    .logo-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 0.75rem;
    }

    .login-header h2 {
        font-size: 1.45rem;
    }

    .login-header p {
        font-size: 0.85rem;
    }

    .form-control {
        font-size: 16px;
        padding: 0.75rem 1rem 0.75rem 2.5rem;
    }

    .password-toggle {
        right: 0.75rem;
    }
}

@media (max-width: 380px) {
    .login-container {
        padding: 1.75rem 1rem;
    }

    .btn-login,
    .btn-google {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}

@media (max-height: 700px) {
    body {
        align-items: flex-start;
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
}