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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #1e40af 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #1f2937;
    position: relative;
    overflow: hidden;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

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

/* Login Container */
.login-container {
    width: 100%;
    max-width: 420px;
    animation: fadeIn 0.6s ease-out;
    position: relative;
    z-index: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Login Header */
.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo-container {
    display: none;
}

.logo {
    display: none;
}

.login-header h1 {
    font-size: 36px;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
    letter-spacing: 0.2px;
}

/* Login Card */
.login-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 36px 28px;
    box-shadow: 
        0 20px 40px -10px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.18);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #6366f1, #8b5cf6);
    border-radius: 20px 20px 0 0;
}

.login-card h2 {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.description {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 28px;
    line-height: 1.5;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 13px 16px;
    font-size: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fafafa;
    color: #111827;
}

.form-group input:hover {
    border-color: #d1d5db;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
    box-shadow: 
        0 0 0 4px rgba(59, 130, 246, 0.1),
        0 1px 2px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.form-group input::placeholder {
    color: #9ca3af;
}

/* Error Message */
.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #dc2626;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-message::before {
    content: "⚠️";
    font-size: 16px;
}

/* Button Styles */
.btn-primary {
    width: 100%;
    padding: 15px 24px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 
        0 4px 12px -2px rgba(59, 130, 246, 0.4),
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

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

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

.btn-primary:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 
        0 8px 20px -4px rgba(59, 130, 246, 0.5),
        0 4px 8px -2px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-primary:active {
    transform: translateY(0) scale(0.99);
    box-shadow: 
        0 2px 8px -2px rgba(59, 130, 246, 0.4),
        inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

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

.btn-primary:disabled:hover {
    transform: none;
    box-shadow: 
        0 4px 12px -2px rgba(59, 130, 246, 0.4),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

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

/* Help Text */
.help-text {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid #f3f4f6;
    text-align: center;
}

.help-text p {
    font-size: 13px;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.help-text p::before {
    content: '🔒';
    font-size: 14px;
    opacity: 0.8;
}

/* Security Badge */
.security-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #059669;
    background: #d1fae5;
    padding: 6px 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
}

.security-badge::before {
    content: '✓';
    font-weight: 700;
    font-size: 14px;
}

/* Responsive Design for Office Add-in */
@media (max-width: 400px) {
    body {
        padding: 12px;
    }

    .login-card {
        padding: 28px 20px;
    }

    .login-header h1 {
        font-size: 28px;
    }

    .login-card h2 {
        font-size: 22px;
    }
    
    .logo {
        width: 64px;
        height: 64px;
    }
}

/* Office Add-in Specific Adjustments */
@media (max-width: 320px) {
    .login-container {
        max-width: 100%;
    }

    .login-card {
        padding: 20px 16px;
    }

    .form-group input {
        padding: 10px 12px;
        font-size: 14px;
    }

    .btn-primary {
        padding: 12px 20px;
        font-size: 15px;
    }
}
