/* ============================================
   DEVSOL AI Platform — Login Page Styles
   Enterprise Orange Theme with Glassmorphism
   ============================================ */

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

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

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.06);
    --accent: #F47C20;
    --accent-hover: #E36B15;
    --accent-glow: rgba(244, 124, 32, 0.3);
    --accent-soft: rgba(244, 124, 32, 0.1);
    --text-primary: #f0f0f5;
    --text-secondary: #8888a0;
    --text-muted: #555570;
    --error: #ff4d6a;
    --success: #00d68f;
    --input-bg: rgba(255, 255, 255, 0.04);
    --input-border: rgba(255, 255, 255, 0.08);
    --input-focus: rgba(244, 124, 32, 0.4);
}

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
}

/* ============================================
   Animated Background
   ============================================ */
.login-wrapper {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(244, 124, 32, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(255, 155, 77, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(244, 124, 32, 0.04) 0%, transparent 50%);
    animation: bgShift 20s ease-in-out infinite alternate;
}

@keyframes bgShift {
    0% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(-2%, -1%) rotate(1deg); }
    66% { transform: translate(1%, 2%) rotate(-0.5deg); }
    100% { transform: translate(-1%, -2%) rotate(0.5deg); }
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 15s ease-in-out infinite;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: rgba(244, 124, 32, 0.15);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
    animation-duration: 18s;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: rgba(255, 155, 77, 0.12);
    bottom: -80px;
    left: -80px;
    animation-delay: -5s;
    animation-duration: 22s;
}

.orb-3 {
    width: 200px;
    height: 200px;
    background: rgba(244, 124, 32, 0.1);
    top: 40%;
    left: 60%;
    animation-delay: -10s;
    animation-duration: 16s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

/* ============================================
   Login Card
   ============================================ */
.login-card {
    position: relative;
    width: 440px;
    max-width: 90vw;
    padding: 48px 40px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.03),
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 120px rgba(244, 124, 32, 0.05);
    animation: cardEntry 0.8s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    opacity: 0;
    transform: translateY(30px) scale(0.98);
    z-index: 10;
}

@keyframes cardEntry {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Logo & Brand */
.login-brand {
    text-align: center;
    margin-bottom: 36px;
}

.login-logo {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: 16px;
    overflow: hidden;
}

.login-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.login-brand h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.login-brand h1 span {
    color: var(--accent);
}

.login-brand p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ============================================
   Form Elements
   ============================================ */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper .icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 18px;
    height: 18px;
    transition: color 0.3s;
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

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

.input-wrapper input:focus {
    border-color: var(--accent);
    background: rgba(244, 124, 32, 0.04);
    box-shadow: 0 0 0 4px rgba(244, 124, 32, 0.1);
}

.input-wrapper input:focus + .icon,
.input-wrapper input:focus ~ .icon {
    color: var(--accent);
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    transition: color 0.3s;
}

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

/* ============================================
   Login Button
   ============================================ */
.btn-login {
    width: 100%;
    padding: 15px;
    margin-top: 8px;
    background: linear-gradient(135deg, #F47C20, #E36B15);
    border: none;
    border-radius: 12px;
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-login::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.15));
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-login:hover::before {
    opacity: 1;
}

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

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-login .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 0 auto;
}

.btn-login.loading .btn-text { display: none; }
.btn-login.loading .spinner { display: block; }

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   Error Message
   ============================================ */
.error-message {
    display: none;
    padding: 12px 16px;
    background: rgba(255, 77, 106, 0.08);
    border: 1px solid rgba(255, 77, 106, 0.2);
    border-radius: 10px;
    color: var(--error);
    font-size: 13px;
    margin-bottom: 20px;
    animation: shake 0.4s ease;
}

.error-message.visible {
    display: flex;
    align-items: center;
    gap: 8px;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* ============================================
   Footer
   ============================================ */
.login-footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
}

.login-footer p {
    font-size: 12px;
    color: var(--text-muted);
}

.login-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.login-footer a:hover {
    color: var(--accent-hover);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 480px) {
    .login-card {
        padding: 36px 24px;
        border-radius: 20px;
    }

    .login-brand h1 {
        font-size: 20px;
    }

    .orb-1, .orb-2, .orb-3 {
        display: none;
    }
}
