/* ============================================
   Modern osTicket Admin Login - FIXED VERSION
   Blue Color Scheme Only
   ============================================ */

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

/* CSS Variables - BLUE PALETTE ONLY */
:root {
    /* Primary Blue Gradient */
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --secondary-color: #0ea5e9;
    --accent-color: #0284c7;
    
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    
    /* Blue Gradient for Background */
    --bg-gradient-start: #3b82f6;
    --bg-gradient-mid: #2563eb;
    --bg-gradient-end: #1d4ed8;
    
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --text-white: #ffffff;
    
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.3);
    
    --border-radius-sm: 0.375rem;
    --border-radius-md: 0.5rem;
    --border-radius-lg: 0.75rem;
    --border-radius-xl: 1rem;
    
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    font-size: 16px;
    overflow-y: auto;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    height: 100%;
    margin: 0;
    text-align: center;
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
}

/* Animated Blue Gradient Background */
#brickwall {
    background: linear-gradient(-45deg, #3b82f6 0%, #2563eb 25%, #60a5fa 50%, #0ea5e9 75%, #0284c7 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -2;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Animated particles overlay */
#brickwall::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    animation: particleFloat 20s ease-in-out infinite;
}

@keyframes particleFloat {
    0%, 100% { opacity: 0.3; transform: translateY(0); }
    50% { opacity: 0.6; transform: translateY(-20px); }
}

#background-compat {
    display: none;
}

#background {
    display: none;
}

#blur {
    display: none;
}

/* Modern Login Box with Glassmorphism */
#loginBox {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius-xl);
    box-shadow: 
        0 8px 32px 0 rgba(31, 38, 135, 0.37),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    animation: slideIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all var(--transition-slow);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

#loginBox:hover {
    box-shadow: 
        0 8px 32px 0 rgba(31, 38, 135, 0.5),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.6),
        0 0 40px rgba(59, 130, 246, 0.3);
}

#loginBox::after {
    display: none;
}

/* Logo Styling */
h1#logo {
    margin: 0 0 1.5rem 0;
}

h1#logo a {
    display: block;
    text-decoration: none;
    height: auto;
    min-height: 80px;
    transition: transform var(--transition-base);
}

h1#logo a:hover {
    transform: scale(1.05);
}

h1#logo img {
    max-height: 70px;
    max-width: 280px;
    height: auto;
    width: auto;
    vertical-align: middle;
    outline: none;
    border: none;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.valign-helper {
    height: 100%;
    display: inline-block;
    vertical-align: middle;
}

/* Login Message */
h3#login-message {
    margin: 0 0 1.5rem 0;
    text-align: center;
    font-size: 1.125rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    color: var(--text-white);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Banner */
div.banner {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-md);
}

div.banner:not(:empty) {
    margin-bottom: 1.5rem;
}

/* Loading Animation */
#loading {
    display: none;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-xl);
}

#loading h1 {
    color: var(--primary-color);
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

#loading i {
    color: var(--primary-color);
}

/* Form Styling */
form {
    width: 100%;
    margin: 0;
}

fieldset {
    border: none;
    margin: 0;
    padding: 0;
}

/* Modern Input Fields */
input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 0.875rem 1rem;
    margin-bottom: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius-md);
    background: rgba(255, 255, 255, 0.9);
    font-size: 0.9375rem;
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    transition: all var(--transition-base);
    outline: none;
}

input[type="text"]::placeholder,
input[type="password"]::placeholder {
    color: var(--text-light);
    font-style: normal;
}

input[type="text"]:focus,
input[type="password"]:focus {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 1);
    box-shadow: 
        0 0 0 3px rgba(59, 130, 246, 0.1),
        0 4px 6px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

/* Modern Buttons - BLUE ONLY */
input[type="submit"],
input[type="reset"],
input[type="button"],
.button,
button[type="submit"] {
    width: 100%;
    padding: 0.875rem 1.5rem;
    margin-top: 0.5rem;
    border: none;
    border-radius: var(--border-radius-md);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--text-white);
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 
        0 4px 6px rgba(37, 99, 235, 0.3),
        0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

button[type="submit"] i,
input[type="submit"] i {
    margin-right: 0.5rem;
}

/* Button hover effect */
input[type="submit"]:hover,
button[type="submit"]:hover,
.button:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #1e40af 100%);
    box-shadow: 
        0 6px 12px rgba(37, 99, 235, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

input[type="submit"]:active,
button[type="submit"]:active,
.button:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 4px rgba(37, 99, 235, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Button ripple effect */
.button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.button:active::before {
    width: 300px;
    height: 300px;
}

.pull-right {
    float: none;
    width: 100%;
}

.pull-center {
    margin: 0 auto;
}

/* Reset Link */
h3 a#reset-link {
    display: inline-block;
    margin: 1rem 0;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-base);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    background: rgba(255, 255, 255, 0.1);
}

h3 a#reset-link:hover {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.hidden {
    display: none !important;
}

/* Divider */
hr {
    margin: 1.5rem 0;
    border: none;
    height: 1px;
    background: linear-gradient(
        to right,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
}

.or {
    position: relative;
    margin: 1.5rem 0;
}

.or hr {
    margin: 0;
}

.or::after {
    content: 'OR';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.15);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-md);
    color: var(--text-white);
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

/* External Auth */
.external-auth {
    display: block;
    margin-bottom: 1rem;
    width: 100%;
}

a.external-sign-in {
    text-decoration: none;
    display: block;
    width: 100%;
}

.external-auth-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    transition: all var(--transition-base);
}

.external-auth-box:hover {
    background: rgba(255, 255, 255, 1);
    border-color: var(--primary-light);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.external-auth-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    width: 50px;
    padding: 1rem;
    border-right: 2px solid rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.02);
}

.external-auth-name {
    flex: 1;
    color: var(--text-dark);
    padding: 1rem;
    font-weight: 500;
    font-size: 0.9375rem;
}

img.sign-in-image {
    border: none;
    max-height: 40px;
    max-width: 200px;
    width: auto;
    height: auto;
}

/* Company Info */
#company {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 20px;
    width: auto;
    max-width: 400px;
    margin: 0;
}

#company .content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-lg);
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    color: var(--text-white);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: inline-block;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Powered By */
#poweredBy {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-lg);
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all var(--transition-base);
}

#poweredBy:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

#poweredBy a {
    color: inherit;
    text-decoration: none;
}

#poweredBy .osticket-logo {
    height: auto;
    width: 60px;
    vertical-align: middle;
    filter: brightness(0) invert(1) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: transform var(--transition-base);
}

#poweredBy:hover .osticket-logo {
    transform: scale(1.05);
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    #loginBox {
        max-width: 90%;
        padding: 2rem 1.5rem;
        top: 45%;
    }
    
    #poweredBy {
        bottom: 10px;
        right: 10px;
        padding: 0.375rem 0.75rem;
        font-size: 0.6875rem;
    }
    
    #poweredBy .osticket-logo {
        width: 50px;
    }
    
    #company {
        bottom: 10px;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    #loginBox {
        max-width: 95%;
        padding: 1.5rem 1rem;
        border-radius: var(--border-radius-lg);
    }
    
    h1#logo img {
        max-height: 50px;
        max-width: 220px;
    }
    
    h3#login-message {
        font-size: 1rem;
    }
    
    input[type="text"],
    input[type="password"] {
        padding: 0.75rem 0.875rem;
        font-size: 0.875rem;
    }
    
    input[type="submit"],
    button[type="submit"],
    .button {
        padding: 0.75rem 1.25rem;
        font-size: 0.9375rem;
    }
    
    #poweredBy {
        position: static;
        display: inline-block;
        margin: 20px auto 60px;
    }
    
    #company {
        position: fixed;
        bottom: 10px;
    }
    
    #company .content {
        font-size: 0.75rem;
        padding: 0.5rem 1rem;
    }
}

@media (max-width: 360px) {
    #loginBox {
        padding: 1.25rem 0.875rem;
    }
    
    h1#logo img {
        max-height: 40px;
        max-width: 180px;
    }
}

@media (max-height: 600px) and (orientation: landscape) {
    #loginBox {
        top: 50%;
        max-height: 90vh;
        overflow-y: auto;
        padding: 1rem;
    }
    
    h1#logo {
        margin-bottom: 0.5rem;
    }
    
    h1#logo img {
        max-height: 40px;
    }
    
    h3#login-message {
        margin-bottom: 0.75rem;
        font-size: 0.9375rem;
    }
    
    input[type="text"],
    input[type="password"] {
        margin-bottom: 0.75rem;
        padding: 0.625rem 0.875rem;
    }
    
    #company {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    #brickwall {
        animation: none;
    }
    
    #brickwall::before {
        animation: none;
    }
}
