/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:root {
    --bg-dark: #07080d;
    --card-bg: rgba(13, 17, 26, 0.55);
    --card-border: rgba(255, 255, 255, 0.08);
    --input-bg: rgba(255, 255, 255, 0.04);
    --input-border: rgba(255, 255, 255, 0.1);
    --input-focus-border: #4f46e5;
    --input-focus-glow: rgba(79, 70, 229, 0.25);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent-glow: linear-gradient(135deg, #6366f1, #4f46e5);
    
    /* Elegant Red for the warning banner */
    --warning-red: #ef4444;
    --warning-red-bg: rgba(239, 68, 68, 0.15);
    --warning-red-border: rgba(239, 68, 68, 0.3);
    --warning-red-glow: rgba(239, 68, 68, 0.25);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Background glowing abstract orbs */
.bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
    mix-blend-mode: screen;
}

.bg-glow-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.6) 0%, rgba(79, 70, 229, 0) 70%);
    top: 15%;
    left: 20%;
    animation: floatOrb 12s ease-in-out infinite alternate;
}

.bg-glow-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.5) 0%, rgba(124, 58, 237, 0) 70%);
    bottom: 10%;
    right: 15%;
    animation: floatOrb 18s ease-in-out infinite alternate-reverse;
}

.bg-glow-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0) 70%);
    top: 45%;
    left: 45%;
    animation: floatOrb 15s ease-in-out infinite alternate;
}

@keyframes floatOrb {
    0% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(30px, -50px) scale(1.1);
    }
    100% {
        transform: translate(-20px, 30px) scale(0.9);
    }
}

/* Main Container */
.container {
    z-index: 10;
    width: 100%;
    max-width: 440px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    animation: cardLoad 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardLoad {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Warning Banner for Internal Use Only */
.warning-banner {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--warning-red-bg);
    border: 1px solid var(--warning-red-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 14px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), inset 0 0 10px var(--warning-red-glow);
    animation: bannerPulse 3s infinite alternate, bannerSlideDown 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.2s backwards;
}

.warning-icon {
    color: var(--warning-red);
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.warning-text {
    color: var(--warning-red);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-shadow: 0 0 10px var(--warning-red-glow);
    text-align: center;
}

@keyframes bannerPulse {
    0% {
        border-color: var(--warning-red-border);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), inset 0 0 10px var(--warning-red-glow);
    }
    100% {
        border-color: rgba(239, 68, 68, 0.5);
        box-shadow: 0 4px 24px rgba(239, 68, 68, 0.15), inset 0 0 14px rgba(239, 68, 68, 0.4);
    }
}

@keyframes bannerSlideDown {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Glassmorphism Login Card */
.login-card {
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Brand Header */
.brand-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-container {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.15) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 16px auto;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.logo-icon {
    color: #818cf8;
    width: 24px;
    height: 24px;
}

.brand-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #ffffff, #d1d5db);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 6px;
}

.brand-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Form Styles */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-label {
    font-size: 0.813rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.2px;
}

.password-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.forgot-password {
    font-size: 0.813rem;
    color: #818cf8;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.forgot-password:hover {
    color: #a5b4fc;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.field-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    width: 18px;
    height: 18px;
    transition: color 0.2s ease;
    pointer-events: none;
}

.input-field {
    width: 100%;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    padding: 14px 16px 14px 44px;
    color: var(--text-primary);
    font-size: 0.938rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
}

.input-field::placeholder {
    color: var(--text-muted);
}

.input-field:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.input-field:focus {
    border-color: var(--input-focus-border);
    background-color: rgba(13, 17, 26, 0.8);
    box-shadow: 0 0 0 4px var(--input-focus-glow);
}

.input-field:focus + .field-icon,
.input-wrapper:focus-within .field-icon {
    color: #818cf8;
}

.toggle-password {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.toggle-password:hover {
    color: var(--text-primary);
}

.toggle-password i {
    width: 18px;
    height: 18px;
}

/* Checkbox Style */
.form-options {
    margin-top: 2px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    user-select: none;
    gap: 8px;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 18px;
    width: 18px;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox-container:hover input ~ .checkmark {
    border-color: rgba(255, 255, 255, 0.2);
}

.checkbox-container input:checked ~ .checkmark {
    background: var(--accent-glow);
    border-color: transparent;
}

.checkmark:after {
    content: "";
    display: none;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-label {
    font-size: 0.813rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    background: var(--accent-glow);
    border: none;
    border-radius: 12px;
    padding: 14px;
    color: white;
    font-size: 0.938rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: 0.5s;
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

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

.btn-arrow {
    width: 16px;
    height: 16px;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.submit-btn:hover .btn-arrow {
    transform: translateX(4px);
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.divider span {
    padding: 0 10px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* SSO / Alternative Login Buttons */
.sso-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sso-btn {
    width: 100%;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    padding: 12px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.sso-btn:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.sso-icon {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

.active-directory-btn .sso-icon {
    color: #00a4ef; /* Microsoft blue accent */
}

/* Card Footer */
.card-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
}

.footer-link {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--text-secondary);
}

.footer-dot {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Toast System */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(13, 17, 26, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 100;
    transform: translateY(100px) scale(0.9);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.toast.show {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

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

.toast-icon {
    color: #818cf8;
    width: 20px;
    height: 20px;
}

.toast-message {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Media Queries */
@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .login-card {
        padding: 30px 20px;
    }
}
